Hello. I’ve been working on this far longer than I’d like to admit. Get-ActiveSyncDevice and Get-ActiveSyncDeviceStatistics don’t play together nearly as well as I’d hoped when it comes to identifying users.
Here is what I have thus far:
$UserList = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true -and -not displayname -like "mm_*"} | Get-Mailbox | Select Alias | Sort-Object Alias | Export-Csv .test.csv -NoTypeInformation} $UserList = Import-Csv .test.csv -Header Alias foreach ($user in $UserList) { Get-ActiveSyncDeviceStatistics -Mailbox $user.Alias | Select DeviceFriendlyName,DeviceType,FirstSyncTime,LastSyncAttemptTime,LastSuccessSync }
It’s incomplete because I do not know how to format the output in a desirable way. Get-ActiveSyncDeviceStatistics provides me with the parameters I want but I want the user name to preface the information. Each user may have 2 or 3 devices so I can’t just transpose the information.
Ideally it would output a CSV that would look something like this for each device:
User: testuser DeviceFriendlyName: phone1 DeviceType: Android FirstSyncTime: 1/1/17 7:00 AM LastSyncAttemptTime: 6/22/17 7:00 AM LastSuccessSync: 6/22/17 7:00 AM
Any help would be appreciated. Thanks!
submitted by /u/HATEFUCK_DELUXE
[link] [comments]
The post Need help retrieving users that utilize Active Sync appeared first on How to Code .NET.