limitation on extract computers list from domain by vbscript
- From: Golden_au <Goldenau@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 22:59:00 -0700
Hi,
I use the following script to extract computers list from active directory
domain, but the problem is it only export 1000 records, is this the
limitation? is there any way to overcome it? many thanks for any advice.
set fs=createobject("scripting.filesystemobject")
set f=fs.opentextfile("C:\ADComputer.txt",2, true)
Dim strdescription
Dim Conn, strRS, RS, strConn
Set Conn = CreateObject("ADODB.Connection")
Set RS = CreateObject("ADODB.Recordset")
Conn.Provider = "ADsDSOObject"
strConn = "Active Directory Provider"
Conn.Open strConn
strRS = "SELECT name, description, whenChanged, whenCreated FROM
'LDAP://ou=Computers, DC=MYDOMAIN, DC=COM' WHERE objectClass = 'Computer'"
RS.Open strRS, Conn, 1, 1
if not (RS.bof and RS.eof) then
RS.movefirst
while not RS.eof
strname=rs("name")
strdescription=RS("description")
strwhenChanged=rs("whenChanged")
strwhenCreated=rs("whenCreated")
if (TypeName(strdescription)="Variant()") then
desc=strdescription(0)
else
desc=""
end if
f.writeline(strname&";"&desc&";"&strwhenCreated&";"&strwhenChanged)
rs.movenext
wend
end if
set f=nothing
set fs=nothing
rs.close
set rs=nothing
conn.close
set conn=nothing
--
Golden_au
.
- Prev by Date: ANN: UpdateSysTray on Codeaholic
- Next by Date: Update MDE Compiled Access project from scripting
- Previous by thread: ANN: UpdateSysTray on Codeaholic
- Next by thread: Update MDE Compiled Access project from scripting
- Index(es):
Relevant Pages
|