- August 19, 2021
- Posted by: Syed Shujaat
- Category: Uncategorized
No Comments
# Powershell script to check Last Reboot Time on a list of machines included in a text file and export the report as a CSV file$machines = Get-Content “D:\Scripts\DiskSpace\Computers_Parallels.txt”
$report = @()
$object = @()
foreach($machine in $machines)
{
$machine
$object = gwmi win32_operatingsystem -ComputerName $machine | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($_.lastbootuptime)}}
$report += $object
}
$report | Export-csv D:\Scripts\DiskSpace\Reboot_Report.csv