Channel | Publish Date | Thumbnail & View Count | Download Video |
---|---|---|---|
Publish Date not found | 0 Views |
Script as below
Server Get content /"c://scripts//LivePCs.txt/"
LiveServer @()
Dead server @()
current date get date
foreach(Server in Servers){
Pingtest Test Connection -ComputerName Server -Quiet -Count 1 -ErrorAction SilentlyContinue
if(pingtest) {
LiveServer /"Server/"
}
otherwise {DeadServer /"Server/" }}
foreach (PC in LiveServer) {Bootuptime (Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName PC).LastBootUpTime
Operating time current date – start time
up Write-Output /"(uptime.Days) days, (uptime.Hours) hours, (uptime.Minutes) minutes/"
Object [pscustomobject]@{
Computer PC
Operating time increased
}
Object Export-Csv -Path /"c://scripts//ServerUptime.csv/" -Append -NoTypeInformation
}
Write-Host /"Unreachable computer as below/"
DeadServer
Please take the opportunity to connect with your friends and family and share this video with them if you find it useful.