J
jogdial
Hi, My Perl is very rusty and I'm having huge problems trying to pull
a common name out of a distinguished name.
The distinguished name(s) example:
"CN=KLAdmins,CN=Users,DC=contuso,DC=com"
"CN=EMLibrary Users,CN=Users,DC=contuso,DC=com"
"CN=Administrators,CN=Builtin,DC=contuso,DC=com"
"CN=Schema Admins,CN=Users,DC=contuso,DC=com"
"CN=Exchange Domain Servers,CN=Ussers,DC=contuso,DC=com"
"CN=Domain Users,CN=Users,DC=contuso,DC=com"
"CN=Enterprise Admins,CN=Users,DC=contuso,DC=com"
"CN=Group Policy Creator Owners,CN=Users,DC=contuso,DC=com"
"CN=Domain Admins,CN=Users,DC=contuso,DC=com"
"CN=Exchange Enterprise Servers,CN=Users,DC=contuso,DC=com"
"CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=contuso,DC=com"
"CN=Users,CN=Builtin,DC=contuso,DC=com"
I just need the first CN value from this. My problem is that I don't
know how to deal with multiple words...
I want to stop on the first comma... but as anything that will match
anything is "greedy" I get all the way to the very last comma, rather
than the first if I try
/"CN=(.*),/
yet I don't konw how many words with spaces between them there are
going to be in the common name. Could be one, could be five or
anything in between.
Seems like it should be simple, but my brain is fried today, can
anyone please help me out with matching this?
Thanks
a common name out of a distinguished name.
The distinguished name(s) example:
"CN=KLAdmins,CN=Users,DC=contuso,DC=com"
"CN=EMLibrary Users,CN=Users,DC=contuso,DC=com"
"CN=Administrators,CN=Builtin,DC=contuso,DC=com"
"CN=Schema Admins,CN=Users,DC=contuso,DC=com"
"CN=Exchange Domain Servers,CN=Ussers,DC=contuso,DC=com"
"CN=Domain Users,CN=Users,DC=contuso,DC=com"
"CN=Enterprise Admins,CN=Users,DC=contuso,DC=com"
"CN=Group Policy Creator Owners,CN=Users,DC=contuso,DC=com"
"CN=Domain Admins,CN=Users,DC=contuso,DC=com"
"CN=Exchange Enterprise Servers,CN=Users,DC=contuso,DC=com"
"CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=contuso,DC=com"
"CN=Users,CN=Builtin,DC=contuso,DC=com"
I just need the first CN value from this. My problem is that I don't
know how to deal with multiple words...
I want to stop on the first comma... but as anything that will match
anything is "greedy" I get all the way to the very last comma, rather
than the first if I try
/"CN=(.*),/
yet I don't konw how many words with spaces between them there are
going to be in the common name. Could be one, could be five or
anything in between.
Seems like it should be simple, but my brain is fried today, can
anyone please help me out with matching this?
Thanks