cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

An issue with a Poweshell monitoring template

Hello,

I am trying to create an template for monitoring the count of file for a share and if so, to be notified. However, I am receiving an error for access denied.I put Execution Mode to Local.

$FileCount =(dir \\mytestcomputer\test |Measure-Object).Count

if ($filecount -ge 1) {

   'Message.filecount: {0} files are written on the share' -f $filecount

} else { 

"Message.filecount: No files exist on the share" 

+ CategoryInfo : PermissionDenied: (\\mytestcomputer\test:String) [Get-ChildItem], UnauthorizedAccessException

  + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

I am successfully access the share via PS from the Solarwinds Server and get file count but not from Solariwinds Console.

The account I am using has a full NTFS permission on the drive and folder and Full share permissions.

Labels (1)
0 Kudos
1 Reply
Level 7

Hi,

I solved my issue by ticking "Run the script under specified account"

Consider the topic as closed

0 Kudos