Hi There,
We have a lot of users working from home and I notice our Direct Access Statistics.ps1 script is not out putting any results to PRTG? This is the script:
Try { $DAC = Get-RemoteAccessConnectionStatisticsSummary -ComputerName DASERVER } Catch [system.exception] { } Finally { $myxml = '<prtg>' + "`n" + '<result>' + "`n" + '<channel>TotalConnections</channel>' + "`n" + '<value>' + $DAC.TotalConnections + '</value>' + "`n" + '</result>' + "`n" + '<result>' + "`n" + '<unit>Custom</unit>' + "`n" + '<Customunit>MB</Customunit>' + "`n" + '<VolumeSize>MegaByte</VolumeSize>' + "`n" + '<Float>1</Float>' + "`n" + '<channel>Total Bytes In Out</channel>' + "`n" + '<value>' + ($DAC.TotalBytesInOut/(1024*1024)) + '</value>' + "`n" + '</result>' + "`n" + '<result>' + "`n" + '<channel>MaxConcurrentConnections</channel>' + "`n" + '<value>' + $DAC.MaxConcurrentConnections + '</value>' + "`n" + '</result>' + "`n" + '</prtg>' $myxml }
Now when I run the .ps1 script manually in Powershell ICE it outputs a value correct
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Direct Access Statistics.ps1 <prtg> <result> <channel>TotalConnections</channel> <value>838</value> </result> <result> <unit>Custom</unit> <Customunit>MB</Customunit> <VolumeSize>MegaByte</VolumeSize> <Float>1</Float> <channel>Total Bytes In Out</channel> <value>498874.701332092</value> </result> <result> <channel>MaxConcurrentConnections</channel> <value>844</value> </result> </prtg>
Any Ideas?
Add comment