To All-
Below is what I have so far, I can only get the server name I need to get the server IP ADDRESS. Is there any way for me to get all the server IP ADDRESS?
----------------------------------------------------------
Sub ShowConnectAD
Dim rootDSE
set rootDSE = Getobject("LDAP://rootDSE")
rootdn = rootDSE.Get("defaultNamingContext")
set objConnection = CreateObject("ADODB.Connection")
set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open = "Active Directory Provider"
End Sub
----------------------------------------------------------
Sub ShowQueryAD
set objCommand.ActiveConnection = objConnection
ObjCommand.CommandText = _
"Select Name, adspath, operatingSystem, machinerole " _
& "from 'LDAP://" & rootdn & "' " _
& "where objectClass = 'computer' and operatingSystem = 'Windows server 2003'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
End Sub
----------------------------------------------------------
Sub ShowProcessServers()
Dim strComputer
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strComputer = objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
End Sub
----------------------------------------------------------
Thanks
Below is what I have so far, I can only get the server name I need to get the server IP ADDRESS. Is there any way for me to get all the server IP ADDRESS?
----------------------------------------------------------
Sub ShowConnectAD
Dim rootDSE
set rootDSE = Getobject("LDAP://rootDSE")
rootdn = rootDSE.Get("defaultNamingContext")
set objConnection = CreateObject("ADODB.Connection")
set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open = "Active Directory Provider"
End Sub
----------------------------------------------------------
Sub ShowQueryAD
set objCommand.ActiveConnection = objConnection
ObjCommand.CommandText = _
"Select Name, adspath, operatingSystem, machinerole " _
& "from 'LDAP://" & rootdn & "' " _
& "where objectClass = 'computer' and operatingSystem = 'Windows server 2003'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
End Sub
----------------------------------------------------------
Sub ShowProcessServers()
Dim strComputer
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strComputer = objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
End Sub
----------------------------------------------------------
Thanks