Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

I need scripting assistance

$
0
0

when I type the following I get everything in distinguishedname

[PS] >Get-ActiveSyncDevice  | select friendlyname, distinguishedname | ft
FriendlyName                                                                              DistinguishedName
------------                                                                              -----------------
BlackBerry Z30                                                                            CN=BlackBerry§BB2BF9C62C,CN=ExchangeActiveSyncDevices,CN=Christopher.Ellis,OU=USERS,OU..

I would like to get only a section of the distinguishedname (not the whole line) I have more than 300 devices

What I would like my output to be (script would select CN=User only - stripping out other info

FriendlyName    DistinguishedName
------------     ------------
BlackBerry Z30    Christopher.Ellis

Thank you for your help

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles