Link to home
Start Free TrialLog in
Avatar of king daddy
king daddyFlag for United States of America

asked on

Help getting UPN, email address, or user name from ActiveSyncDeviceStatistics or Get-MobileDeviceStatistics

This is what I am using to get a Mobile Device report from our Office 365 server. I get Identity in the report, but it looks like this and is not easy to work with.

SERVER.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/company365.onmicrosoft.com/Display Name/ExchangeActiveSyncDevices/Android?androidc97397597
SERVER.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/company365.onmicrosoft.com/Display Name/ExchangeActiveSyncDevices/iPhone?7YHLOI8DER5HCN01HYHY8UDEC

This is the power shell I am running:

$Mailboxes = Get-Mailbox -Identity $_.UserPrincipalName -RecipientTypeDetails UserMailbox -ResultSize Unlimited
$Devices = $Mailboxes | %{Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity} | `?{$_.LastSuccessSync | export-csv PATH

I need to get the email address, UPN, or even the user's display name in a column.

Any help much appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of king daddy

ASKER

Thanks, Vasil. It is running now.
Perfect. Thanks again, Vasil.