Mobile Devices Export

Modified on Tue, 30 Jun at 4:51 PM


 

$csv = "C:\temp\MobileDevices.csv"

$results = @()

$mailboxUsers = get-mailbox -resultsize unlimited

$mobileDevice = @()

 

foreach($user in $mailboxUsers)

{

$UPN = $user.UserPrincipalName

$displayName = $user.DisplayName

 

$mobileDevices = Get-MobileDevice -Mailbox $UPN

       

      foreach($mobileDevice in $mobileDevices)

      {

          Write-Output "Getting info about a device for $displayName"

          $properties = @{

          Name = $user.name

          UPN = $UPN

          DisplayName = $displayName

          FriendlyName = $mobileDevice.FriendlyName

          ClientType = $mobileDevice.ClientType

          ClientVersion = $mobileDevice.ClientVersion

          DeviceId = $mobileDevice.DeviceId

          DeviceMobileOperator = $mobileDevice.DeviceMobileOperator

          DeviceModel = $mobileDevice.DeviceModel

          DeviceOS = $mobileDevice.DeviceOS

          DeviceTelephoneNumber = $mobileDevice.DeviceTelephoneNumber

          DeviceType = $mobileDevice.DeviceType

          FirstSyncTime = $mobileDevice.FirstSyncTime

          UserDisplayName = $mobileDevice.UserDisplayName

          }

          $results += New-Object psobject -Property $properties

      }

}

 

$results | Select-Object Name,UPN,FriendlyName,DisplayName,ClientType,ClientVersion,DeviceId,DeviceMobileOperator,DeviceModel,DeviceOS,DeviceTelephoneNumber,DeviceType,FirstSyncTime,UserDisplayName | Export-Csv -notypeinformation -Path $csv

 

Remove-PSSession $session

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article