-1

So I need to find information as in the topic. I found that get-mobiledevice is quite OK, but it lacks two major informations for me: UPN of user, who used it and the time, when it was used.

I can use get-mobiledevicestatistics to get time of last login, but I don't know how to pipeline the result of get-mobiledevice, which would list me all of the mobile devices, to run the get-mobiledevicestatistics for each of them (and I know, this only resolves the information of mobiles, no desktops).

Neither will get me the UPN as well.

Do you know, how to connect all those commands to get, what I need?

kjubus
  • 145
  • 1
  • 2
  • 9

1 Answers1

0

I think you could try the following commands:

$mailboxes = Get-Mailbox -ResultSize Unlimited 
$report1 = @()
$report2 = @()
Foreach ($mb in $mailboxes) { 
$report2 = Get-MobileDeviceStatistics -Mailbox:$mb.Identity | Select-Object @{label=”User” ; expression={$mb. PrimarySmtpAddress }},DeviceModel,DeviceOS, lastsuccesssync
$report1+=$report2
} 
$report1| Export-csv c:\test\activesync.csv 

In my testing, it would list all the activesync devices information and user’s UPN like this: enter image description here Here is a similar case for details.

Shaw Lu
  • 339
  • 1
  • 4