OpManager script monitoring access is denied

OpManager script monitoring access is denied

hi Guys,

I wrote a PS script to remote detect SQL status on SQL DB server, the PS script run in OpManager server (CMD prompt) have no issue, but if configure in script monitor in OpManager, and click test script button, then get below error.

Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005

(E_ACCESSDENIED))

At C:\ManageEngine\OpManager\bin\temp\OpManager_307_1465747192152.ps1:12

char:13

+ $processes= Get-WmiObject -namespace "root\cimv2" -ComputerName $deviceName

-Cla ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~

    + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedA

   ccessException

    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow

   erShell.Commands.GetWmiObjectCommand


cmd /c powershell.exe -ExecutionPolicy RemoteSigned .\${FileName}.ps1 ${DeviceName} ${UserName} ${Password} svchost.exe


Regards
Thanks...KEN

                New to ADSelfService Plus?