how to get exact user name from get-mobiledevicestatistics in powershell
问题 I have a small script to get all user mobile devices info from exchange 2013 server. Get-Mailbox -ResultSize Unlimited | ForEach {Get-MobileDeviceStatistics -Mailbox:$_.Identity} | Select-Object @{label="User" ; expression={$_.Identity}},DeviceOS, lastsuccesssync I just want to get an exact user name instead of a path in AD. How can I do it in expression={?} Here is another script to do it, it gives me the user name, but all devices belongs to user are not in separated lines, they all in one