Error connecting to AD using ADSI and LDAP on NT4 
Author Message
 Error connecting to AD using ADSI and LDAP on NT4

I'm having a problem with a VBScript I initially wrote and tested on a
Windows 2000 client, running on an NT 4 client (both using scripting engine
5.1 and 5.5, and ADSI 2.5, NT4 SP6a).

I'm trying to use the getobject method using the LDAP syntax, sorta like
(just an example, I haven't got the script to hand - I'm at home, but this
is the relevant bits, from memory...):-

set Dse=getobject("LDAP://RootDSE")

strDomain="LDAP://"&Dse.Get("defaultNamingContext")

set Domain=getobject(strDomain)
set ParentOU=Domain.getobject("organizationalUnit","OU=Computers")

...and so on.

Background: what I want to do is group desktop PCs (NT4 workstations
(specifically their AD objects), clients to a W2K domain in native mode) in
OUs with the printer objects, then, in the login script, search all the
relevant OUs to find the OU that the PC is in, identify the printers in that
OU, then create connections to the printer(s).

The script works just peachy on Windows 2000 clients, opens AD, using LDAP,
identifies and navigates the appropriate OUs, and creates the printer
connections OK. However when I try and run the script on NT4 machines
(versions as above), it fails as soon as it gets to the "set
Dse=getobject("LDAP://RootDSE")" line, (from memory the error is 8007001f).
Other scripts I've played with in testing, on these NT4 clients, correctly
identify LDAP as a usable namespace.

I'm pretty new to vbscript / WSH / ADSI - I previously did most of this sort
of thing using Kixtart, and I'm sorta learning this as I go. I was sort of
under the impression that (assuming the same versions of the scripting
engine, and ADSI support) that scripts should work across platforms.

Can anyone let me know what I'm doing wrong, and / or suggest a technique
that will work, cross-platform, in which I can descend OU hierarchies,
searching (using filters) as I go?

Thanks in advance for any help.



Mon, 30 Dec 2002 03:00:00 GMT  
 Error connecting to AD using ADSI and LDAP on NT4
Have you found a solution for this? I also have this error.

Debbie



Quote:

> I'm having a problem with a vbscript I initially wrote and tested on a
> Windows 2000 client, running on an NT 4 client (both using scripting
engine
> 5.1 and 5.5, and ADSI 2.5, NT4 SP6a).

> I'm trying to use the getobject method using the LDAP syntax, sorta
like
> (just an example, I haven't got the script to hand - I'm at home, but
this
> is the relevant bits, from memory...):-

> set Dse=getobject("LDAP://RootDSE")

> strDomain="LDAP://"&Dse.Get("defaultNamingContext")

> set Domain=getobject(strDomain)
> set ParentOU=Domain.getobject("organizationalUnit","OU=Computers")

> ...and so on.

> Background: what I want to do is group desktop PCs (NT4 workstations
> (specifically their AD objects), clients to a W2K domain in native
mode) in
> OUs with the printer objects, then, in the login script, search all
the
> relevant OUs to find the OU that the PC is in, identify the printers
in that
> OU, then create connections to the printer(s).

> The script works just peachy on Windows 2000 clients, opens AD, using
LDAP,
> identifies and navigates the appropriate OUs, and creates the printer
> connections OK. However when I try and run the script on NT4 machines
> (versions as above), it fails as soon as it gets to the "set
> Dse=getobject("LDAP://RootDSE")" line, (from memory the error is
8007001f).
> Other scripts I've played with in testing, on these NT4 clients,
correctly
> identify LDAP as a usable namespace.

> I'm pretty new to vbscript / WSH / ADSI - I previously did most of
this sort
> of thing using Kixtart, and I'm sorta learning this as I go. I was
sort of
> under the impression that (assuming the same versions of the scripting
> engine, and ADSI support) that scripts should work across platforms.

> Can anyone let me know what I'm doing wrong, and / or suggest a
technique
> that will work, cross-platform, in which I can descend OU hierarchies,
> searching (using filters) as I go?

> Thanks in advance for any help.

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 03 Jan 2003 03:00:00 GMT  
 Error connecting to AD using ADSI and LDAP on NT4
AFAIK, unless you have an LDAP server running on NT4 (it doesn't have it's
own), you can't use the LDAP syntax.  Try using the WinNT syntax:

set Dse = GetObject("WinNT://<servername>/<objetc name>")

If you get errors from this, first make sure that you have `WinNT' and not just
`winnt' as in my tests it is case specific.

HTH


Quote:

>Have you found a solution for this? I also have this error.

>Debbie



>> I'm having a problem with a vbscript I initially wrote and tested on a
>> Windows 2000 client, running on an NT 4 client (both using scripting
>engine
>> 5.1 and 5.5, and ADSI 2.5, NT4 SP6a).

>> I'm trying to use the getobject method using the LDAP syntax, sorta
>like
>> (just an example, I haven't got the script to hand - I'm at home, but
>this
>> is the relevant bits, from memory...):-

>> set Dse=getobject("LDAP://RootDSE")

>> strDomain="LDAP://"&Dse.Get("defaultNamingContext")

>> set Domain=getobject(strDomain)
>> set ParentOU=Domain.getobject("organizationalUnit","OU=Computers")

>> ...and so on.

>> Background: what I want to do is group desktop PCs (NT4 workstations
>> (specifically their AD objects), clients to a W2K domain in native
>mode) in
>> OUs with the printer objects, then, in the login script, search all
>the
>> relevant OUs to find the OU that the PC is in, identify the printers
>in that
>> OU, then create connections to the printer(s).

>> The script works just peachy on Windows 2000 clients, opens AD, using
>LDAP,
>> identifies and navigates the appropriate OUs, and creates the printer
>> connections OK. However when I try and run the script on NT4 machines
>> (versions as above), it fails as soon as it gets to the "set
>> Dse=getobject("LDAP://RootDSE")" line, (from memory the error is
>8007001f).
>> Other scripts I've played with in testing, on these NT4 clients,
>correctly
>> identify LDAP as a usable namespace.

>> I'm pretty new to vbscript / WSH / ADSI - I previously did most of
>this sort
>> of thing using Kixtart, and I'm sorta learning this as I go. I was
>sort of
>> under the impression that (assuming the same versions of the scripting
>> engine, and ADSI support) that scripts should work across platforms.

>> Can anyone let me know what I'm doing wrong, and / or suggest a
>technique
>> that will work, cross-platform, in which I can descend OU hierarchies,
>> searching (using filters) as I go?

>> Thanks in advance for any help.

>Sent via Deja.com http://www.deja.com/
>Before you buy.



Sat, 04 Jan 2003 03:00:00 GMT  
 Error connecting to AD using ADSI and LDAP on NT4

Quote:
> AFAIK, unless you have an LDAP server running on NT4 (it doesn't have
it's
> own), you can't use the LDAP syntax.

You can use the LDAP protocol from NT against Active Directory, however,
you cannot do a serverless bind using LDAP://RootDSE unless your are in a
Win2000 Active Directory domain.

Specify a server name e.g. ldap://serverX/RootDSE

Stuart



Sat, 11 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error connecting to AD using ADSI and LDAP on NT4

2. Has anyone successfully connected to an LDAP directory using ADSI

3. connecting to OU in adsi with LDAP

4. Using VB to access Exchange Server via ADSI/LDAP

5. LDAP field values from 3rdparty Directory using ADSI and VB

6. LDAP field values from 3rdparty Directory using ADSI and VB

7. Using VB to access Exchange Server via ADSI/LDAP

8. LDAP search using ADSI sdk for VB

9. Newbie Q Trying to connect to Exchange using Ldap

10. Newbie Q Trying to connect to Exchange using Ldap

11. Error encountered while trying to use ADSI and LDAP

12. How to query a non-Windows LDAP server using ADSI and vbscript

 

 
Powered by phpBB® Forum Software