Intune Initial Scripts Backup

This commit is contained in:
2025-04-21 14:21:38 -04:00
commit 71764cd10f
241 changed files with 28218 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#import correct file
#Uncomment Restart-Computer
$Server_Reboot_Before_Patching = Import-Csv E:\WSUS_Scripts\Files\PENDING-Reboots-10-08-2019.csv | ? { $_.RebootPending -eq "True" } | select computer
$Server_Reboot_Before_Patching.Computer | % {
Write-EventLog -LogName System -Source "Powershell-WSUS-Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Remote" -ErrorAction SilentlyContinue
Invoke-Command $_ -ErrorAction SilentlyContinue {
New-EventLog -LogName System -Source "Reboot-Before-Patching" -ErrorAction SilentlyContinue
Write-EventLog -LogName System -Source "Reboot-Before-Patching" -EntryType Information -EventId 7893 -Message "Reboot-Before-Patching-Invoke" -ErrorAction SilentlyContinue
}#endInvoke
Restart-Computer $_ -Force -Verbose
}#end%