troubleshooting Question

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

Avatar of king daddy
king daddyFlag for United States of America asked on
PowershellExchangeMobileMicrosoft 365
3 Comments1 Solution142 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros