I have the following power shell which reports on current Activesync partnerships. I use the select statement to pull 4 fields that I am concerned with and it works but I am looking to manipulate the results of the identity just to clean it up a bit. The identity field currently shows up as Domain/OU/SubOU/UserName/ExchangeActiveSyncDevices/Device. Is there any way I can extract just the "UserName" portion from this?
$users = Get-CASMailbox -Filter {hasactivesyncdevicepartnership -eq $true} | Get-Mailbox$users | foreach {Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity} | select identity,devicemodel,firstsynctime,lastsuccesssync