first commit
This commit is contained in:
10
PS/pLastBoot.ps1
Normal file
10
PS/pLastBoot.ps1
Normal file
@ -0,0 +1,10 @@
|
||||
$computers = @("server","surgery12") #list of computers
|
||||
foreach ($computer in $computers) {
|
||||
$wmi = ""
|
||||
if (Test-Connection $computer -Quiet){
|
||||
$wmi = Get-WmiObject -Class win32_OperatingSystem -ComputerName $computer
|
||||
if (($wmi.ConvertToDateTime($wmi.LocalDateTime) - $wmi.ConvertToDateTime($wmi.LastBootUpTime)).Days -gt 6){
|
||||
Start-Process "cmd.exe" "/c C:\Scripts\Base\tmessageH.bat RebootTheServer"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user