Home

Get a list of mobile devices syncing with my tenant

%3CLINGO-SUB%20id%3D%22lingo-sub-257219%22%20slang%3D%22en-US%22%3EGet%20a%20list%20of%20mobile%20devices%20syncing%20with%20my%20tenant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-257219%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20everyone%20is%20well.%20Can%20someone%20perhaps%20assist%20me%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20get%20list%20of%20all%20the%20mobiles%20devices%20that%20is%20currently%20syncing%20with%20my%20Office%20365%20tenant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20some%20scripts%20online%20but%20I%20am%20bit%20reluctant%20to%20use%20those.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAppreciate%20any%20advice...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-257219%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-259620%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20a%20list%20of%20mobile%20devices%20syncing%20with%20my%20tenant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-259620%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20don't%20want%20to%20use%20PowerShell%2C%20simply%20use%20the%20Exchange%20Online%20Admin%20Center%3F%20There%20is%20also%20an%20report%20in%20the%20O365%20admin%20portal%3A%20%3CA%20href%3D%22https%3A%2F%2Fportal.office.com%2Fadminportal%2Fhome%23%2FreportsUsage%2FEmailClients%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fportal.office.com%2Fadminportal%2Fhome%23%2FreportsUsage%2FEmailClients%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-258290%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20a%20list%20of%20mobile%20devices%20syncing%20with%20my%20tenant%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-258290%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20try%20this%20script%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24credential%20%3D%20Get-Credential%3C%2FP%3E%3CP%3E%24Session%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20%3CA%20href%3D%22https%3A%2F%2Fps.outlook.com%2Fpowershell%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.outlook.com%2Fpowershell%3C%2FA%3E-Credential%20%24credential%20-Authentication%20Basic%20-AllowRedirection%3CBR%20%2F%3EImport-PSSession%20%24Session%3C%2FP%3E%3CP%3E%24mdevices%20%3D%20Get-MobileDevice%20-ResultSize%20Unlimited%3CBR%20%2F%3E%24mdevices%20%7C%20Foreach-Object%7B%3CBR%20%2F%3E%24mdevice%20%3D%20%24_%3CBR%20%2F%3E%24mstats%20%3D%20%24mdevice%20%7C%20Get-MobileDeviceStatistics%3CBR%20%2F%3ENew-Object%20-TypeName%20PSObject%20-Property%20%40%7B%3CBR%20%2F%3EUserDisplayName%20%3D%20%24mdevice.UserDisplayName%3CBR%20%2F%3EDeviceFriendlyName%20%3D%20%24mdevice.FriendlyName%3CBR%20%2F%3EDeviceId%20%3D%20%24mdevice.DeviceId%3CBR%20%2F%3EDeviceImei%20%3D%20%24mdevice.DeviceImei%3CBR%20%2F%3EDeviceFirstSyncTime%20%3D%20%24mdevice.FirstSyncTime%3CBR%20%2F%3EDeviceAdminDisplayName%20%3D%20%24mdevice.AdminDisplayName%3CBR%20%2F%3EDeviceName%20%3D%20%24mdevice.Name%3CBR%20%2F%3EDeviceLastSuccessSync%20%3D%20%24mstats.LastSuccessSync%3CBR%20%2F%3EDevicePhoneNumber%20%3D%20%24mstats.DevicePhoneNumber%3CBR%20%2F%3EStatus%20%3D%20%24mstats.Status%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%7CExport-csv%20-Path%20C%3A%5Cresult.csv%20-NoTypeInformation%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hi All

 

Hope everyone is well. Can someone perhaps assist me please?

 

I need to get list of all the mobiles devices that is currently syncing with my Office 365 tenant.

 

I found some scripts online but I am bit reluctant to use those.

 

Appreciate any advice...

2 Replies

You can try this script

 

$credential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $credential -Authentication Basic -AllowRedirection
Import-PSSession $Session

$mdevices = Get-MobileDevice -ResultSize Unlimited
$mdevices | Foreach-Object{
$mdevice = $_
$mstats = $mdevice | Get-MobileDeviceStatistics
New-Object -TypeName PSObject -Property @{
UserDisplayName = $mdevice.UserDisplayName
DeviceFriendlyName = $mdevice.FriendlyName
DeviceId = $mdevice.DeviceId
DeviceImei = $mdevice.DeviceImei
DeviceFirstSyncTime = $mdevice.FirstSyncTime
DeviceAdminDisplayName = $mdevice.AdminDisplayName
DeviceName = $mdevice.Name
DeviceLastSuccessSync = $mstats.LastSuccessSync
DevicePhoneNumber = $mstats.DevicePhoneNumber
Status = $mstats.Status
}
}|Export-csv -Path C:\result.csv -NoTypeInformation

 

If you don't want to use PowerShell, simply use the Exchange Online Admin Center? There is also an report in the O365 admin portal: https://portal.office.com/adminportal/home#/reportsUsage/EmailClients

Related Conversations