Show activesync users with powershell
Powershell command to display the users who uses Active-sync to connect with smartphones to the exchange server.
1 2 3 4 |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://cas001/PowerShell/ -Authentication Kerberos Import-PSSession $Session Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and ActiveSyncEnabled -eq $true} |
to count the users, place the result in a variable an use count.
1 2 |
$users = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and ActiveSyncEnabled -eq $true} $users.count |