Re: Scripting newbie - Active Directory reporting of users/description

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jun 29, 1:53 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:

You can use ADO in a VBScript program to retrieve information about objects
in AD. This is not cpu intensive, most of the work is done efficiently on
the Domain Controller. For more on using ADO, see this link:

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

An example to retrieve Distinguished Name, NT Name (pre-Windows 2000 logon
name), and description for all users would be:
==================

Thank you for such a quick reply Richard.

I am playing with the script that you graciously provided. The script
is failing on a "undefined variable" error.

The error is as follows:

ListUsers.vbs(76, 9) Microsoft VBScript runtime error: Variable
is undefined: 'arrGroups'


arrDesc = adoRecordset.Fields("description").Value

If IsNull(arrDesc) Then
strDesc = ""
Else
For Each strItem In arrGroups
^^^^^^^^^^^ ---> should this be
"arrDesc"?

strDesc = strItem
Next
End If


As indicated above, should the line be "For Each strItem In arrDesc"
instead of arrGroups?

Malcolm

.



Relevant Pages

  • Re: Scripting newbie - Active Directory reporting of users/description
    ... You can use ADO in a VBScript program to retrieve information about ... For Each strItem In arrGroups ...
    (microsoft.public.windows.server.scripting)
  • Re: find all the dial in users
    ... You can use this LDAP query in ADUC, the "View" pulldown, "Filter ... query with the csvde or ldifde utilities to retrieve information on these ... And you can run a VBScript program using ADO and this query to retrieve ...
    (microsoft.public.windows.server.active_directory)
  • Re: find all the dial in users
    ... You can use this LDAP query in ADUC, the "View" pulldown, "Filter ... query with the csvde or ldifde utilities to retrieve information on these ... And you can run a VBScript program using ADO and this query to retrieve ...
    (microsoft.public.windows.server.active_directory)
  • Re: Script needed to query empid from email address
    ... You can use ADO in a VBScript program to retrieve information from AD on ... ' Move to the next record in the recordset. ... run a command similar to this at a command prompt: ...
    (microsoft.public.windows.server.scripting)
  • Re: Exporting Users Address
    ... ADO can be used in a VBScript program to retrieve information like this. ... ' Bind to Excel object. ... ' Start writing values in row 2 of spreadsheet. ...
    (microsoft.public.scripting.vbscript)