Afficher un message
Vieux 25/09/2007, 17h14   #1
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Amateur Scripter Question

meek wrote:

>I can't get my script to work on objects nestled in 2 OU levels deep. They
> only work in the 1st OU level. For example: OU=United States, OU=New
> York.
> If the object is in the New York OU, it doesn't work. If I move it up to
> the
> United States OU it works. Is there something extra you need to do to
> touch
> objects nestled 2 OU's deep?


If the components of the AdsPath are comma delimited as in your example,
your ADSI binding string is in Little-Endian form. This is the default (I
have never seen anyone use the alternative Big-Endian form). The components
are listed in order from the lowest level to the highest. The last
components in the AdsPath are the domain. The first component is the
relative distinguished name of the specific object you are referencing.

In your example, "ou=United States" resides in "ou=New York", which doesn't
seem likely. I assume the components are listed in the wrong order. To bind
to the user "cn=Jim Smith" in "ou=United States", which is in the root of
the domain "MyDomain.com", you would use:

Set objUser1 = GetObject("LDAP://cn=Jim Smith,ou=United
States,dc=MyDomain,dc=com")

If "ou=New York" is in "ou=United States" ("ou=New York" is a child of the
parent "ou=United States"), you would bind to the user "cn=Mary Johnson" in
"ou=New York with:

Set objUser2 = GetObject("LDAP://cn=Mary Johnson,ou=New York,ou=United
States,dc=MyDomain,dc=com")

Does this ?

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


  Réponse avec citation
 
Page generated in 0,05768 seconds with 9 queries