Share via


List Mobile Devices connected using ActiveSync on Office 365

http://i0.wp.com/yshvili.com/wp-content/uploads/2016/03/listmobiloffice365.jpg

            

Connect to Exchange Online

               

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Get-Mailbox -ResultSize Unlimited | ForEach {Get-MobileDeviceStatistics -Mailbox:$_.Identity} | export-csv “c:\ActiveSyncDevices.csv”

Remove-PSSession $Session

Connect to Exchange Online using remote PowerShell