View Single Post
Old 06-25-2009   #5 (permalink)
Richard Mueller [MVP]


 
 

Re: Active Directory information

The attribute name (also called the property name) is "description". For the
names of attributes that correspond to fields in ADUC, see the first
spreadsheet in this link:

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

In VBScript the steps to retrieve description would be similar to below:
========
' Bind to user object using Distinguished Name.
Set objUser = GetObject("LDAP://cn=Jim Smith,ou=West,dc=MyDomain,dc=com")
' Retrieve and display value of "description" attribute.
strDescription = objUser.description
Wscript.Echo strDescription
=======
If you have the "pre-Windows 2000 logon" name of the user, you must either
use the WinNT provider (which is slower and not recommended) or use the
NameTranslate object to convert to the Distinguished Name. In this case, the
WinNT provider exposes the property with the same name. For example, if the
NetBIOS name of the domain is "MyDomain" and the "pre-Windows 2000 logon"
name of the user is "JSmith", the following VBScript code will retrieve
description:
===========
' Bind to user object NT (pre-Windows 2000) Name.
Set objUser = GetObject("WinNT://MyDomain/JSmith,user")
' Retrieve and display value of "description" attribute.
strDescription = objUser.description
Wscript.Echo strDescription
=======
If this doesn't help, we will need to see some code. For information on
using NameTranslate, see this link:

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

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"JeffH" <JeffH@xxxxxx> wrote in message
news:3A1D879C-60D7-49B5-B013-21A5DCC0FADB@xxxxxx
Quote:

> I'm trying to extract information out of AD and put it into a text file.
> I
> know the object name, and I don't know what the Field name should be.
>
> Thanks again,
> JeffH
>
> "Cary Shultz" wrote:
>
Quote:

>> There is 100% a field called 'Description' - for both Users and
>> Computers.
>>
>> What is it that you are trying to do? Simply see if there is anything
>> entered? Or, are you trying to put stuff there?
>>
>> Cary
>>
>> "JeffH" <JeffH@xxxxxx> wrote in message
>> news:80E8D971-450E-4064-8314-BDABFC12391A@xxxxxx
Quote:

>> > Hi,
>> >
>> > There's a field in Active Directory Users and Computers called
>> > 'Description'. I tried using the property name 'Description' and it
>> > returns
>> > nothing. Does anyone know what the name of the property is? Or how I
>> > can
>> > track it down.
>> >
>> > Thanks in advance,
>> > JeffH
>>
>>

My System SpecsSystem Spec