Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Active Directory information

Reply
 
Old 06-25-2009   #1 (permalink)
JeffH


 
 

Active Directory information

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
Old 06-25-2009   #2 (permalink)
Cary Shultz


 
 

Re: Active Directory information

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
Old 06-25-2009   #3 (permalink)
Richard Mueller [MVP]


 
 

Re: Active Directory information

The "description" attribute is a bit unusual. It is actually a multi-valued
string attribute, even though there is never more than one value. Depending
on how you are retrieving the value this can make a difference. You probably
need to treat the value retrieved as an array. In VBScript you can use the
TypeName function to verify this. Of course, nothing is returned if there is
no value assigned.

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

"Cary Shultz" <cshultz@xxxxxx> wrote in message
news:elLYIVa9JHA.4168@xxxxxx
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
Old 06-25-2009   #4 (permalink)
JeffH


 
 

Re: Active Directory information

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

Thread Tools


Similar Threads
Thread Forum
Active Directory Vista mail
Active Directory Vista security
Extending Active Directory Schema for Bitlocker recovery information Vista General
Extending Active Directory Schema for Bitlocker recovery information Vista security
Collecting information from Active Directory PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46