Hi, I try tu run some simply check on my Exchange 2013 Database server. I have DAG and want to be alarmed, when my database is moved to another node. I wrote script in Powershell:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn; $GlobalDBStat = 0 $AllDBs = Get-MailboxDatabase | Where-Object {$_.Name -like 'xxxxxx'} foreach ($DB in $AllDBs) { Write-Host $DB.Server If ($DB.Server -ne 'xxxxx') { $GlobalDBStat = 1 } } Write-Host $GlobalDBStat,":"
If I run the script locally on the server, it works of course like a charm and changes $GlobalDBStat param to 1 if any of the database is not on the particular server. But when I run it from the sensor, it always returns 0. I've tried different actions - ran the PRTG Probe Service as user, who definitely has permissions in Exchange Organization, put credentials in parent device, etc. It looks like the script (when run as a sensor) is not able to get Exchange object - the question is - why.
I'll be grateful for any help. Best Regards Marcin
Add comment