Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Mon, 28 Jul 2008 22:59:00 -0700,    group: microsoft.public.inetsdk.programming.scripting.vbscript        back       


limitation on extract computers list from domain by vbscript   
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
date: Mon, 28 Jul 2008 22:59:00 -0700   author:   Golden_au

RE: limitation on extract computers list from domain by vbscript   
Can you tell me what is the LDAP name for Computer objects in Active Directory?
I want to use it as an attribute in a third party software.

Thanks.

"Golden_au" wrote:

> 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
date: Mon, 20 Oct 2008 14:19:03 -0700   author:   netsafire

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us