Anybody know of a way for me to attach via LDAP to my AD to get the WINNT
domain name?

--

Paul Bergson

Re: LDAP Query to find out the WINNT Domain Name by Al

Al
Mon Jan 23 19:16:59 CST 2006

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
>



Re: LDAP Query to find out the WINNT Domain Name by Paul

Paul
Mon Jan 23 19:34:47 CST 2006

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
>>
>
>



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
>>>
>>
>>
>
>



Re: LDAP Query to find out the WINNT Domain Name by Paul

Paul
Tue Jan 24 19:03:51 CST 2006

Worked great

--


Paul Bergson

.


"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
>>
>
>



Re: LDAP Query to find out the WINNT Domain Name by Paul

Paul
Tue Jan 24 19:04:50 CST 2006

Got it working via wsh thanks though

--


Paul Bergson


"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
in message news:OCRElIJIGHA.2628@TK2MSFTNGP15.phx.gbl...
> 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
>>>>
>>>
>>>
>>
>>
>
>