26 Dec 2023 12:16 AM
I'm trying to establish a metric of the number of remote logged in users in Windows servers.
I'm trying to do it through WMI, but still working on how to do it...
Has anyone managed to do this?
Solved! Go to Solution.
29 Dec 2023 11:46 AM
Just to give Feedback on how I managed to do it. Used query below to grab number of active sessions in Terminal Services, and then coded a v2 extension:
$computerName = "192.168.111.20"
$credential = Get-Credential
Get-WmiObject -Class Win32_PerfFormattedData_LocalSessionManager_TerminalServices -ComputerName $computerName -Credential $credential | Select-Object -ExpandProperty ActiveSessions