Skip to content

Get the uptime of multiple remote servers. Used after creation for an environment of 19.5k servers both Windows and Linux (this script will ONLY work with Windows. Linux servers will throw an error)

License

Notifications You must be signed in to change notification settings

praveen1619/get-uptime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Server Uptime Script

This PowerShell script retrieves the uptime of a list of servers and outputs the results to a CSV file. The script reads a list of server hostnames from a file named server.txt (that you must create) and retrieves the uptime of each server using the Get-Uptime cmdlet. The output is then written to a CSV file named output.csv (you must create this), which includes the hostname, hours since last reboot, and online status for each server.

Prerequisites

  • Windows PowerShell 3.0 or higher
  • A list of server hostnames in a text file named server.txt

Usage

  1. Clone or download the repository to your local machine.
  2. Add the list of server hostnames to a text file named server.txt. Each server hostname should be on a separate line.
  3. Open PowerShell and navigate to the directory where the script is located.
  4. Run the script using the following command:
.\server-uptime.ps1
  1. The output will be written to a CSV file named output.csv in the same directory as the script.

Notes

  • If a server is offline or unreachable, the script will output a message indicating that the server is offline in the CSV file.
  • The output file will be overwritten each time the script is run, so be sure to save a copy of the previous output if needed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Get the uptime of multiple remote servers. Used after creation for an environment of 19.5k servers both Windows and Linux (this script will ONLY work with Windows. Linux servers will throw an error)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%