Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > Query DnsDomainName by NETBIOS domain name via LDAP?

Reply
Thread Tools Display Modes

Query DnsDomainName by NETBIOS domain name via LDAP?

 
 
Michael Ströder
Guest
Posts: n/a

 
      11-17-2006
HI!

If I have only know the NETBIOS domain name can I query the DNS-based
domain name in AD via LDAP? Maybe via global catalog?

Many thanks in advance.

Ciao, Michael.
 
Reply With Quote
 
 
 
 
Joe Kaplan
Guest
Posts: n/a

 
      11-17-2006
If you do a search in the configuration container for crossRef objects, you
can use a filter based on nETBIOSName and return the dnsRoot or nCName
attributes to get either of those two values. You don't need to use a GC,
as any DC will have the same configuration partition, but you can.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Michael Ströder" <> wrote in message
news:ef6134-...
> HI!
>
> If I have only know the NETBIOS domain name can I query the DNS-based
> domain name in AD via LDAP? Maybe via global catalog?
>
> Many thanks in advance.
>
> Ciao, Michael.



 
Reply With Quote
 
 
 
 
Michael Ströder
Guest
Posts: n/a

 
      11-17-2006
Joe,

thanks for answering so quickly. In the meantime I already found this
answer by you in another forum and did some tests.

Joe Kaplan wrote:
> If you do a search in the configuration container for crossRef objects, you
> can use a filter based on nETBIOSName and return the dnsRoot or nCName
> attributes to get either of those two values. You don't need to use a GC,
> as any DC will have the same configuration partition, but you can.


In my tests 'nETBIOSName' and 'nCName' were not available on the GC
(port 3268) anyway. The query only worked on DC (port 389).

Just to make sure this also works in a multi-domain environment:
Does each DC have knowledge in CN=Partitions,CN=Configuration,.. about
all domains in the forest?

What I'm after:
I know the sAMAccountName and the NETBIOS domain name and I have to find
the userPrincipalName based on that information.
=> so I have to:
1. determine the DnsDomainName by searching under CN=Partitions,.. and
afterwards
2. query the DC of this particular domain for sAMAccountName for
retrieving the user's entry.

Unfortunately my customer also has three forests...

Ciao, Michael.
 
Reply With Quote
 
Joe Kaplan
Guest
Posts: n/a

 
      11-17-2006
Sorry, I forgot to check to see if those attributes are in the PAS and they
are not, so they won't be in the GC, only on the DC via normal LDAP.

The configuration partition is replicated to all DCs in the forest and
contains the same stuff, so you can still use any DC you want to get this
information. That is just "per forest" though.

Given what you are trying to do, have you considered the DsCrackNames API or
the IADsNameTranslate interface (which is an ADSI wrapper for DsCrackNames).
It does all this heavy lifting for you. Pass in the NT account name
(domain\user) and ask for the UPN back. It can translate lots of different
formats and do batches of names at a time. It is also very fast.

Just a thought.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Michael Ströder" <> wrote in message
news:...
> Joe,
>
> thanks for answering so quickly. In the meantime I already found this
> answer by you in another forum and did some tests.
>
> Joe Kaplan wrote:
>> If you do a search in the configuration container for crossRef objects,
>> you
>> can use a filter based on nETBIOSName and return the dnsRoot or nCName
>> attributes to get either of those two values. You don't need to use a
>> GC,
>> as any DC will have the same configuration partition, but you can.

>
> In my tests 'nETBIOSName' and 'nCName' were not available on the GC
> (port 3268) anyway. The query only worked on DC (port 389).
>
> Just to make sure this also works in a multi-domain environment:
> Does each DC have knowledge in CN=Partitions,CN=Configuration,.. about
> all domains in the forest?
>
> What I'm after:
> I know the sAMAccountName and the NETBIOS domain name and I have to find
> the userPrincipalName based on that information.
> => so I have to:
> 1. determine the DnsDomainName by searching under CN=Partitions,.. and
> afterwards
> 2. query the DC of this particular domain for sAMAccountName for
> retrieving the user's entry.
>
> Unfortunately my customer also has three forests...
>
> Ciao, Michael.



 
Reply With Quote
 
Michael Ströder
Guest
Posts: n/a

 
      11-17-2006
Joe,

thanks again for your quick answers.

Joe Kaplan wrote:
>
> Given what you are trying to do, have you considered the DsCrackNames API or
> the IADsNameTranslate interface (which is an ADSI wrapper for DsCrackNames).


This is to be implemented in Java.
Is there something like this available for Java?

Ciao, Michael.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Netbios Domain Name Different From Full DNS Domain Name In Active Directory Cris Hanna[SBS-MVP] Windows Small Business Server 0 10-17-2006 08:34 PM
Error: can't find _ldap._tcp.dc._msdc.<DNSDomainName> Ron DNS Server 5 04-24-2006 05:01 PM
RE: Use NT domain NetBIOS name for AD NetBIOS name? james huntt Server Migration 3 07-28-2005 07:06 AM
Disabling NetBIOS and NetBIOS style domain name ChanKaiShi Active Directory 1 10-08-2004 03:01 PM