‘##########################################################################
‘# Purpose : To check the ping status of computers part of a security group
‘# Author : Sitaram Pamarthi
‘#
‘##########################################################################
‘On Error Resume Next‘ Replace with your group DN
GroupDN=”ldap://CN=Your/ Group Name,OU=Your OU name,DC=domain,DC=com”Set objGroup = GetObject(GroupDN)
objGroup.GetInfo
arrMemberOf = objGroup.GetEx(“member”)
For Each strMember in arrMemberOf
Set objGroup1 = GetObject(“LDAP://” & strMember)
strHost=trim(objGroup1.dNSHostName)
set objPing = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery _
(“select * from Win32_PingStatus where address = ‘” & strHost & “‘”)for each objRetStatus in objPing
if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
WScript.Echo strhost & ” ==> host not reachable”
else
Ping = True
wscript.echo strhost & ” ==> Machine Reachable”
end if
next
Next‘#End of script.
Sitaram Pamarthi