Created
July 17, 2017 22:19
-
-
Save sqrtofsaturn/2069bca6c74c5d47595729368c93cdf2 to your computer and use it in GitHub Desktop.
Count Active XenDesktop Sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -Path "C:\Program Files (x86)\Citrix\ICA Client\WfIcaLib.dll" | |
$ICA = New-Object WFICALib.ICAClientClass | |
$SessionsEnum = $ICA.EnumerateCCMSessions() | |
$SessionsCount = $ICA.GetEnumNameCount($SessionsEnum) | |
$obj = New-Object PSObject | |
Add-Member -InputObject $obj -MemberType NoteProperty -Name sessionsCount -Value $SessionsCount | |
Write-Host ($obj | ConvertTo-JSON) | |
$ICA.CloseEnumHandle($EnumSessions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment