I'd like to request a Monitor to validate the availability of Windows or SMB file shares.

--Joel

asked 02 Mar '15, 17:06

ashmite's gravatar image

ashmite
55411
accept rate: 50%


Well, this seemed like a good time to start working with the PowerShell object model for PA.

I wrote this script that looks at the SYSYVOL share on a monitored DC, but it can easily be adapted to work against a generic file share by changing the path in the $Folder variable. It'd be a simple task to change the path to a Custom Property if that works better for you.

$Mon.FireActions = $False
$Name = $Mon.ComputerName
$Mon.Details = ""
$Folder = "\\" + $Name + "\Sysvol"

If ((Test-Path $Folder) -eq $False)
{
  $Mon.FireActions = $true
  $Mon.Details = "SYSVOL is not accessible on " + $Name
}
Else
{
  $Mon.Details = "SYSVOL is accessible on " + $Name
  $Mon.FireActions = $False
}
link

answered 04 Mar '15, 13:39

ashmite's gravatar image

ashmite
55411
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×33
×1
×1
×1

Asked: 02 Mar '15, 17:06

Seen: 5,081 times

Last updated: 04 Mar '15, 13:39