Showing posts with label Exchange. Show all posts
Showing posts with label Exchange. Show all posts

Tuesday, June 6, 2017

How to get a list of ActiveSync users and devices from command line.

$mbx=get-mailbox

$mbx | foreach {$name = $_.name; $alias = $_.alias; $device = get-activesyncdevicestatistics -mailbox $_.identity; $device | foreach {write-output "$alias;$name;$($_.devicefriendlyname);$($_.deviceid);$($_.LastSuccessSync)"} } >list.txt

This is the output. One line for each mobile device.

smithb;Smith, Bob;iPad Air;Appl345SDFGDFG;06/06/2017 16:05:01
smithb;Smith, bob;iPhone 7;SDFGD987938798;06/05/2017 16:06:00
...

Friday, June 2, 2017

How to get list of ActiveSync users from the Exchange command line.

This will provide a simple list like below.


Get-ActiveSyncDevice | select UserDisplayName, devicetype

example.com/ou/Smith, Bob       iPhone
example.com/ou/Smith, John     Android
example.com/ou/Smith, Kelly     SAMSUNGMG955U