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,32 @@
$Check_Jobs = Import-Csv "E:\WSUS_Scripts\Patching-Day\December-2019\Tier2B-December-Patching\ReRun\Tier2B-FAILED-Jobs-22-01-PM.csv" | select @{n="Server";e={$_.Name.split('#')[1]}},State,PSBeginTime
##$Completed_Jobs = $Check_Jobs | ? { $_.State -eq "Completed" }
##$Failed_Jobs = $Check_Jobs | ? { $_.State -eq "Failed" }
#$P_Job_Servers = @()
##### Reboot Completed Ones and Run patching again #####
#Restart-Computer $Completed_Jobs.Server -Force -Verbose
Foreach ($S in $Completed_Jobs.Server) {
#$S = $T.name
#$P_Job_Servers += Start-Job -ScriptBlock { Param($S) WindowsUpdate\Install-WindowsUpdate -ComputerName $S } -Name "$WSUSGroup-#$S#-Patching" -ArgumentList $S
}#endForeach
<#
$Tier2B_Servers."Server Name" | % { $T = Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue
If($T) { Write-Host "Server $_ -- Responding" -ForegroundColor Green } Else { Write-Host "Server $_ -- Not Responding" -ForegroundColor Red }
}
#######################################################################################################
$Tier2B_Servers."Server Name" | % { gwmi win32_operatingsystem -ComputerName $_ | select @{n="Server";e={$_.PSComputername}},@{n="LastBootup";e={$_.Converttodatetime($_.LastBootUpTime)}}} | ft -autosize
#>