first commit

This commit is contained in:
USER
2023-01-17 23:15:21 +00:00
commit 773c15c6ce
27 changed files with 1059 additions and 0 deletions

10
PS/pLastBoot.ps1 Normal file
View 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"
}
}
}