Please help me with the script below. I'm using it to list all the computers from the Servers OU in a specified domain in Active Directory. Unfortunately, the script (which is a modified version of Listing 5.30 in the Microsoft Windows 2000 Scripting guide) only returns the first 1,000 entries. We have more than 1,000 computers in my enterprise. What do I need to do to retrieve all computers and not just the first 1,000? If I can't retrieve an unlimited number of computers, can I turn some setting up to an obscenely high number like 2,000,000 and accomplish the same goal? All help is appreciated
-raj
--------------------------------------------------------------------------------------------------------------------------------------------
Option Explici
On Error Resume Nex
'************************************
'* Explicitly Defined Variables
'************************************
Dim objConnectio
Dim objComman
Dim objRecordSe
Dim fqd
Dim o
'Establish and initialize connection to Active Directory Databas
Set objConnection = CreateObject("ADODB.Connection"
objConnection.Open "Provider=ADsDSOObject;
Set objCommand = CreateObject("ADODB.Command"
objCommand.ActiveConnection = objConnectio
'Search command passed to active director
objCommand.CommandText =
"<LDAP://ou=Servers,dc=my,dc=domain,dc=net>;(objectCategory=computer)" &
";name,operatingSystem;subtree
Set objRecordSet = objCommand.Execut
While Not objRecordSet.EO
fqdn = objRecordSet.Fields("Name"
os = objRecordSet.Fields("operatingSystem")
Wscript.Echo os & " " & fqd
objRecordSet.MoveNex
Wen
'Close Active Directory Connectio
objConnection.Close