Title: RE: [ActiveDir] Determine user's Netbios/DNS Domain Name
ï
I might be over simplifying but without testing this myself, I'd suggest the following as but one of no doubt numerous approaches -
 
a) Reduce the dn you have from:
    CN=$Brian Desmond,OU=Tech Dept,OU=Accounts,DC=payton,DC=cps,DC=k12,DC=il,DC=us
    ... to:
    DC=payton,DC=cps,DC=k12,DC=il,DC=us
 
... ok, forget it - just saw Joe's post ... use number 2 ... number 1 may not succeed in the case of disjoint DNS/AD namespaces.
 
Dean
 
--
Dean Wells
MSEtechnology
* Email: dwells@msetechnology.com
http://msetechnology.com
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Desmond
Sent: Sunday, August 29, 2004 7:33 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Determine user's Netbios/DNS Domain Name

Doing this in .net. I can use a COM component if that's the only way. I was hoping there was an attribute on the user or somewhere up the tree.
 
Thanks,
Brian
 
-----Original Message-----
From: joe [mailto:[EMAIL PROTECTED]
Sent: Sun 8/29/2004 4:33 PM
To: [EMAIL PROTECTED]
Cc:
Subject: RE: [ActiveDir] Determine user's Netbios/DNS Domain Name

I think you want IADsNameTranslate Brian assuming you are using ADSI.

http://msdn.microsoft.com/library/default.asp?url="">


Richard has a good writeup on it at

http://www.rlmueller.net/NameTranslateFAQ.htm


Basically you convert from ADS_NAME_TYPE_1779 to ADS_NAME_TYPE_NT4 and then chop off the domain piece.


If you are in batch, take a look at my UserName tool on www.joeware.net which will return whatever format you want for the current user.


  joe


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Brian Desmond
Sent: Sunday, August 29, 2004 4:09 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Determine user's Netbios/DNS Domain Name

Is there an attribute that I can look at if I'm bound to a username to find out the user's domain name?

For example, if I'm bound to myself:

 CN=$Brian Desmond,OU=Tech Dept,OU=Accounts,DC=payton,DC=cps,DC=k12,DC=il,DC=us

How can I programatically determine one of the two: my netbios domain name is WPCP or my DNS name is payton.cps.k12.il.us?

Thanks,
Brian
..jjryãv

List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to