Windows Servers Uptime Report using PowerShell

Hi Folks,

A customer has mix of Windows servers (2012, 2016, 2019) on-premises environment. Customer needs to generate a report via PowerShell about the availability of servers. During my search I found a script on this link.

and its modified version is attached here.

Please note, this script reads windows events and based on that produces result. There is a problem where I need help, this script doesn’t run against list of servers via a CSV file or a text file and we suspect it is not producing correct result.

Can somebody please review this script and help us with the right syntax or what is missing here?

Thanks in advance.

Welcome to the forum. :wave:t4:

When you find some code or a script online and you have a problem with it or some questions about it you should aks the author first.

Please do not share code or scripts via file download. Either post the code here - formatted as code - or use one of the many code share platforms like the original code you’ve found.

This is the wrong place to ask for a code review. You may try it here:

And last buit not least …

When you crosspost the same question at the same time to different forums you should at least mention that you did and post links to the other forums along with your question to avoid people willing to help you making their work twice or more.