Q: How can I use a logon username to determine a user's
distinguished name (DN)?
A: The NameTranslate object can translate a username into a DN that you can use
to reference an Active Directory (AD) account. Use the following steps:
- Create an instance of the NameTranslate object.
- Use the Init method to initialize the Name-Translate object.
- Pass the user s name to the NameTranslate object s Set method.
- Call the NameTranslate object's Get method to retrieve the user's DN.
Listings 1 and 2,
GetDN.vbs and GetDN.js, show a VBScript and JScript version, respectively, of
a GetDN function that follows these steps. Callout A in both listings illustrates
the first two steps. (For more information about the parameters to the Initmethod,
see the Microsoft article IADsNameTranslate::Init at http://msdn2.microsoft.com/en-us/library/aa706046.aspx.) . . .
ddoimo August 26, 2008 (Article Rating: