'Get Exchange Servers 'From Scott Souther (checkqueue.hta) Dim Conn, Com, Rs, IADRootDSE, varConfigNC, strQuery Dim i : i = 0 Dim arrServers(10) Set Conn = createobject("ADODB.Connection") Set com = createobject("ADODB.Command") Set rs = createobject("ADODB.Recordset") ' Get the configuration naming context Set iAdRootDSE = GetObject("LDAP://RootDSE") varConfigNC = iAdRootDSE.Get("configurationNamingContext") ' Open the connection Conn.Provider = "ADsDSOObject" Conn.Open "ADs Provider" ' Build the query to find all Exchange Server computers. strQuery = ";(objectCategory=msExchExchangeServer);name,versionnumber;subtree" Com.ActiveConnection = Conn Com.CommandText = strQuery Set Rs = Com.Execute While Not Rs.EOF If rs.fields ("versionnumber") > 4417 then wscript.echo RS.Fields("name") arrServers(i) = RS.Fields("name") i = i + 1 End if rs.movenext Wend