I need scripting assistance

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


No Data
  • cmje said:
    I have dealt with you on different occasions, I have found that you are not very helpful.

    Wow.  Not really sure what that means.  I looked back over our joint history and it seems that we only intersected on two posts.

    Your final reply was:  It worked exactly as you stated  - the only thing I changed was the servers.txt path.  Thank you.

    On this one Jaap took over as the subject matter expert so I went into read-only mode.

    Sorry you find me offensive.  I have added you to my "Do not disturb" list so as not to bother you.

    Best wishes on your PowerShell journey.


No Data