Re: LDAP Query to find out the WINNT Domain Name by Joe
Joe
Mon Jan 23 20:59:04 CST 2006
If you really want an LDAP query for this, search for an object in the
configuration partition (in the Partitions container if you want to be more
specific) with objectClass=crossRef and nCName= the defaultNamingContext for
the domain in question. The nETBIOSName attribute on it will contain what
you are looking for.
Joe K.
"Paul Bergson" <pbergson@allete.com> wrote in message
news:uTF4dZIIGHA.3348@tk2msftngp13.phx.gbl...
> Thanks I'll give this a shot i wrote a script that will pull multiple user
> attributes and I want to make it portable for any AD lan.
>
> --
>
> Paul
>
>
>
> "Al Mulnick" <amulnick_No_SPAM@ncDOTrr.com> wrote in message
> news:uvPyaPIIGHA.3700@TK2MSFTNGP15.phx.gbl...
>> You mean the netbios name? From which perspective? From the client
>> perspective something like this would work (I haven't checked the wire to
>> see what it's calling exactly):
>>
>> '* find domain name - NetBIOS
>> dim WshNetwork, strDomainName
>> Set WshNetwork = WScript.CreateObject("WScript.Network")
>> strDomainName = WshNetwork.UserDomain
>> msgbox "User NetBIOS domain = " & WshNetwork.UserDomain
>>
>> For just LDAP, IIRC it's the name attribute value of the domainDNS object
>> although a quick look shows that DC also holds the same information on
>> the domainDNS object.
>>
>> Search base: dc=domain,dc=com
>> Filter: (objectClass=domainDNS)
>>
>> -ajm
>>
>> "Paul Bergson" <pbergson@allete_nospam.com> wrote in message
>> news:%230uD4cHIGHA.3460@TK2MSFTNGP12.phx.gbl...
>>> Anybody know of a way for me to attach via LDAP to my AD to get the
>>> WINNT domain name?
>>>
>>> --
>>>
>>> Paul Bergson
>>>
>>
>>
>
>