scripting help.. please

  • Thread starter Thread starter anonymous
  • Start date Start date
A

anonymous

Is there an easy way to figure out a user's current
container information. For example. I found a user at
cn=user1,ou=usa,dc=company,dc=com I need to get
ou=usa,dc=company,dc=com out of that string so I can move,
rename, or delete the user ID. Any hints would be
approciated.
 
If you already have the object set you can use the "ADsPath" method to get the current container information for the object. This is real handy if you are retrieving things through a ADO search method. If you just want the shortened OU path use the Parent method

Example 1
set adsUser=GetObject("LDAP://cn=Test User,ou=users,dc=test,dc=com"
strpath = adsUser.ADsPat
wscript.echo strpat

----> Displays LDAP://cn=Test User,ou=users,dc=test,dc=co

Example 2
set adsUser=GetObject("LDAP://cn=Test User,ou=users,dc=test,dc=com"
strpath = adsUser.Paren
wscript.echo strpath

----> Displays LDAP://ou=users,dc=test,dc=co

----- anonymous wrote: ----

Is there an easy way to figure out a user's current
container information. For example. I found a user at
cn=user1,ou=usa,dc=company,dc=com I need to get
ou=usa,dc=company,dc=com out of that string so I can move,
rename, or delete the user ID. Any hints would be
approciated
 
Back
Top