Detect Windows Standard vs Enterprise remotely
hi all,
i trying figure out way find version of os remotely, either registry search or snmp get. know group of servers running standard or enterprise edition. know of way?
thanks,
roberto
you should able query ad this, eliminating need connect each computer remotely. operatingsystem attribute of computer objects have values "windows server 2008 r2 standard". query ad computers operatingsystem attribute has string "server" , either "standard" or "enterprise".
i have example vbscript program retrieves servers linked here:
http://www.rlmueller.net/enumerate%20servers.htm
the ldap syntax filter used in program is:
(&(objectcategory=computer)(operatingsystem=*server*))
this revised, perhaps to:
(&(objectcategory=computer)(operatingsystem=*server*)(operatingsystem="standard"))
or (since computer objects have operatingsystem attribute):
(operatingsystem=windows server 2008 r2 standard)
the strings not case sensitive. add operatingsystem attribute comma delimited list of attributes retrieve, in loop resulting recordset enumerated, can output value of operatingsystem. result follows, find computers "standard" "server" os:
option explicit dim objrootdse, strdnsdomain, adoconnection, adocommand, strquery dim adorecordset, strcomputerdn, strbase, strfilter, strattributes dim stros ' determine dns domain name rootdse object. set objrootdse = getobject("ldap://rootdse") strdnsdomain = objrootdse.get("defaultnamingcontext") ' use ado search active directory. set adocommand = createobject("adodb.command") set adoconnection = createobject("adodb.connection") adoconnection.provider = "adsdsoobject" adoconnection.open "active directory provider" adocommand.activeconnection = adoconnection ' search entire domain. strbase = "<ldap://" & strdnsdomain & ">" ' filter on computer objects standard server operating system. strfilter = "(&(objectcategory=computer)(operatingsystem=*server*)(operatingsystem=*standard*))" ' comma delimited list of attribute values retrieve. strattributes = "distinguishedname,operatingsystem" ' construct ldap syntax query. strquery = strbase & ";" & strfilter & ";" & strattributes & ";subtree" adocommand.commandtext = strquery adocommand.properties("page size") = 100 adocommand.properties("timeout") = 30 adocommand.properties("cache results") = false set adorecordset = adocommand.execute ' enumerate computer objects standard server operating systems. until adorecordset.eof strcomputerdn = adorecordset.fields("distinguishedname").value stros = adorecordset.fields("operatingsystem").value wscript.echo strcomputerdn & " (" & stros & ")" adorecordset.movenext loop ' clean up. adorecordset.close adoconnection.close
a similar powershell script can coded, using same ldap syntax filters.
richard mueller - mvp directory services
Windows Server > Windows Server General Forum
Comments
Post a Comment