Im trying to extract computer names from active directory, ive googled it and found this script.
However it doesnt work, i guess i need to change some parts..but i dont have any idea which parts to change!!
This is what i found..
Set objDictionary = CreateObject("Scripting.Dictionary")
i = 0
Set objOU = GetObject("LDAP://CN=Computers, DC=fabrikam, DC=com")
objOU.Filter = Array("Computer")
For Each objComputer in objOU
objDictionary.Add i, objComputer.CN
i = i + 1
Next
For Each objItem in objDictionary
Set colServices = GetObject("winmgmts://" & _
objDictionary.Item(objItem) _
& "").ExecQuery("Select * from Win32_Service")
Wscript.Echo colServices.Count
Next
Do i just copy this into notepad and save it as a vbs file??
Thanks


LinkBack URL
About LinkBacks
Reply With Quote
