I keep trying to figure things out myself but my head is getting bruised from hitting it against my desk...
I am trying to extract the CN from LDAP however I cannot seem to get it right. Here are a few sanitized examples from our LDAP:
CN=Montana\, Joe,OU=FortyNiners,OU=sfPlayers,DC=AD,DC=SF49ERS,DC=COM
CN=Learning Center Group (LIB),OU=FortyNiners,OU=LIB,OU=sfInfrastructure,DC=AD,DC=SF49ERS,DC=COM
CN=Bumgardner\, Madison,OU=Giants,OU=sfPlayers,DC=AD,DC=SFGiants,DC=COM
CN=Rice\, Jerry,OU=FortyNiners,OU=sfPlayers,DC=AD,DC=SF49ERS,DC=COM
CN=SFO-SFPD Airport TSA Officers,OU=Exchange Distribution Groups,OU=TSA,OU=sfPeople,DC=AD,DC=GOV,DC=ORG
CN=TSAGtw,CN=123-A415N628R6YUP,OU=Workstations,OU=TSA,OU=sfDevices,DC=AD,DC=GOV,DC=ORG
Note that the second line has the acronym in parenthesis and the last line has two CNs. I am trying to capture the CN data into a new field which would result in:
Montana\, Joe
Learning Center Group (LIB)
Bumgardner\, Madison
Rice\, Jerry
SFO-SFPD Airport TSA Officers
TSAGtw,123-A415N628R6YUP
Extra credit would be if I can not match the "\," in the middle of the CNs but can live with them if need be.
Please if anyone can help...
Thanks.
Dave
... View more