' Read Arguments from an Active Directory Container
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