Intune Initial Scripts Backup
This commit is contained in:
28
dump/WSUS_Scripts/ReRun-Quick.ps1
Normal file
28
dump/WSUS_Scripts/ReRun-Quick.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
$servers = Import-Csv "E:\WSUS_Scripts\Patching-Day\December-2019\Tier0-December-Patching\ReRun\.csv" | select name
|
||||
Get-Job | Remove-Job
|
||||
$S2 = @()
|
||||
$T = @()
|
||||
$servers | % { $T += $_.Name.Split('#')[1] }
|
||||
$P_Job_Failed_Servers = @()
|
||||
|
||||
Foreach ($S in $T) {
|
||||
#$S = $T.name
|
||||
$P_Job_Failed_Servers += Start-Job -ScriptBlock { Param($S) WindowsUpdate\Install-WindowsUpdate -ComputerName $S } -Name "$WSUSGroup-#$S#-Patching" -ArgumentList $S
|
||||
|
||||
}#endForeach
|
||||
|
||||
$P_Job_Failed_Servers | ft -AutoSize
|
||||
|
||||
|
||||
<#
|
||||
|
||||
|
||||
$Failed_J = Get-Job | ? { $_.State -eq "Failed" } | Select Name
|
||||
$Failed_J | % { $S2 += $_.Name.Split('#')[1] }
|
||||
|
||||
|
||||
#>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user