Chris,
How about the code below? You will need to add in a way to output the code,
but this will populate an array with accounts in my domain.
set oRootDSE = GetObject("LDAP://RootDSE")
set oDom = GetObject("LDAP://" & oRootDSE.Get("defaultNamingContext"))
Set cObjs = GetObject("WinNT://" & mid(oDom.name,4))
iCnt = 0
For Each oObj In cObjs
if ucase(oObj.Class) = "COMPUTER" Then
ReDim preserve sComputers(iCnt)
sComputers(iCnt) = oObj.name
iCnt = iCnt + 1
End if
Next
Brian M. Smith
[EMAIL PROTECTED]
-----Original Message-----
From: Chris Levis [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 10:37 AM
To: NT 2000 Discussions
Subject: Vbscript help for AD task
I'm trying to write a bit of code (vbscript, preferably) that will walk
through every OU in my AD structure, and for each object that is a computer,
stuff that computers name into an array.
I've been banging my head for a while now, and I'm wondering if anyone has
done this already.
TIA
_______________________
There are 10 types of people in the world: those who understand binary, and
those who do not.
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%
------
You are subscribed as [email protected]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]