Hi,
We are monitoring a Citrix server using an agent.
We like to monitor the Broker Shared Desktop value, for this we have a small powershell script.
Our problem is that the script is executed as SYSTEM user that has no right to execute the desired command.
Basically the script is the following
add-pssnapin Citrix.Broker.Admin.V2
$maintenance=(BrokerSharedDesktop | select DNSName,InMaintenanceMode | Where {$_.InMaintenanceMode -like 'False'} | Measure-Object);
Write-Host "statistic:"$maintenance.count
Write-Host "Message:"$maintenance.count
the snapin is added successfully however the command is not executed.
a troubleshooting version
try {add-pssnapin Citrix.Broker.Admin.V2}catch {write-host "not added"}try {get-BrokerSharedDesktop}catch { $ErrorMessage = $_.Exception.Messagewrite-host "$ErrorMessage"}
return the following message
Output: ==============================================
Insufficient administrative privilege
so the SYSTEM user is able to add the snapin but to execute the command added.
How can i simply use other credential that i know are working fine ?
Cheers