Asked by:
How to check if multiple servers are down/inactive already?

Question
-
Hi, Guys.
How to check if multiple servers are down/inactive already?
Thank you.
Wednesday, January 30, 2019 5:25 AM
All replies
-
What does that mean? What does "down" meam? What does "inactive" mean?
How to ask questions in a technical forum
Please carefully review the following links to set your expectation for posting in technical forums.
\_(ツ)_/
Wednesday, January 30, 2019 5:38 AM -
Hi,
Thanks for your question.
"Test-Connection" cmdlet can help you test the connection with the server.
https://blogs.technet.microsoft.com/heyscriptingguy/2012/02/24/use-powershell-to-test-connectivity-on-remote-servers/
Mike Glavin post a server status monitor PowerShell script in script gallery. I hope it can help you.
https://gal.vin/2017/07/28/windows-server-status/
Best Regards,
Just do it.
Wednesday, January 30, 2019 8:35 AM -
use the cmdlet
if (-not (test-Connection -computername -Count 1)) {do something if Computer is offline}
regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
Friday, February 1, 2019 3:16 PM -
I posted this script I have used in the other forum where you asked this question:
# Retrieve all servers (including DCs) in the domain. $Servers = (Get-ADComputer -LDAPFilter "(operatingSystem=*server*)").Name ForEach ($Server In $Servers) { # Ping each Server. If ((Test-Connection -ComputerName $Server -Count 1 -Quiet) -eq $True) { "Server $Server OK" } Else {"Server $Server is not available"} } # To retrieve only member servers (not DCs), use: # -LDAFilter "(&(operatingSystem=*server*)(!(userAccountControl:1.2.840.113556.1.4.803:=8192)))"
Edit: To retrieve only member servers (not DCs), use this LDAP filter instead:
-LDAFilter "(&(operatingSystem=*server*)(!(userAccountControl:1.2.840.113556.1.4.803:=8192)))"
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Edited by Richard MuellerMVP Friday, February 1, 2019 3:31 PM
Friday, February 1, 2019 3:30 PM