Uptime report – PowerShell

Uptime report – PowerShell

Following the post about the Defender status report in PowerShell, I decided to create a script that will generate a list of servers based on Active Directory data, just like in the previous case, and gather information about the current UpTime and last boot time.

In the first step, we need to retrieve a list of computers or servers. If we have this list in a file, we can use it. However, I am obtaining the list of machines from Active Directory.

The variable $ComputerList will contain all the hosts to be checked.

Now, I will present the code that checks each host from the list and queries for uptime. As in the previous post, I’ve also implemented a safeguard to ensure that unreachable hosts are not included in the final report.

After the script has executed, the results will be displayed in a table:


Komentarze

Nie ma jeszcze komentarzy. Może zaczniesz dyskusję?

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *