AD query

  • Thread starter Thread starter aaron
  • Start date Start date
A

aaron

does anyone know how to get a list of the service pack levels of all the
computers in AD?
can't seem to find the search for that field.

TIA,
aaron
 
does anyone know how to get a list of the service pack levels of all the
computers in AD?
can't seem to find the search for that field.

TIA,
aaron

You can do this with Joe Richard's handy-dandy adfind command
(www.joeware.net):

adfind -default -f operatingSystemServicePack=*
operatingsystemServicePack

(that is really one line, but will probably wrap).

You could also run the query using LDP, ldifde, csvde, and VBScript
(w/ADSI+ADO), just to name a few. You could do an Advanced Search in AD
U&C, but operatingSystemServicePack is not one of the available columns,
so it won't do you much good...

Wayne
 
I would use WMI for the job.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem",,48)
For Each objItem in colItems
Wscript.Echo "BootDevice: " & objItem.BootDevice
Wscript.Echo "BuildNumber: " & objItem.BuildNumber
Wscript.Echo "BuildType: " & objItem.BuildType
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "CSDVersion: " & objItem.CSDVersion
Next

Where you can substitute strComputerName with any computername on the
network. "." represents localhost.

--
Regards

Matjaz Ladava, MCSE, MCSA, MVP
Microsoft MVP - Active Directory
(e-mail address removed), (e-mail address removed)
http://ladava.com
 
Grab adfind from www.joeware.net on the free win32 tools page

adfind -b dc=domain,dc=com -f objectcategory=computer operatingsystem operatingsystemservicepack

change dc=domain,dc=com to the domain you want to query.
 
Back
Top