Given an LDAP distinguishedName (dn) value, such as "CN=JohnDoe,OU=Sales,OU=Users,OU=Corporate,DC=contoso,DC=msft" you can strip out just the value assigned to the first CN= set using VBscript as follows:
CleanName = Replace(Split(DN,",")(0), "CN=", "")
This will return "JohnDoe"
Thursday, 10 February 2011
LDAP / AD script stuff
Posted on 09:34 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment