Hi,
I wrote a ps1-Script that executes remote on hosts to monitor connectivity of routes:
param ( [string]$computerName = "127.0.0.1", [string]$target = "127.0.0.1" ) Try{ $res = Test-Connection -Source $computerName -ComputerName $target $retTime=$res[0].ResponseTime write-host ([string]::Format("{1}: Antwort von {0} in {1} ms",$target,$retTime)) Exit 0 } Catch{ write-host ([string]::Format("0: Ziel {0} nicht erreichbar! {1}",$target, $_.Exception.Message)) Exit 1 }
I created exesensors for several devices, using parameters like "-computerName %host -target 8.8.8.8" and the security context of the device. The script runs well on domain members (using domain name and username from device settings), but fails on a workgroup machines with Access denied (PE095).
Credentials for the workgroup machine are set with machine name and "Administrator", according to the manual this should result in the local user "Administrator" then.
On the PRTG probe server I added the above box as trusted host:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value myworkgroupbox Restart-Service WinRM
The workgroup machine was configured for remote powershell:
Set-ExecutionPolicy Unrestricted
but I still get this error! Note: all powershell settings were made with x86 PS.
From a powershell window on the probe this works like expected:
Test-Connection -source myworkgroupbox -computername 8.8.8.8 -Credential myworkgroupbox\Administrator
I highly appreciate any help with this,
Stefan
Add comment