Skip to content

Commit

Permalink
Update secure-standalone.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
simeononsecurity committed Apr 7, 2023
1 parent 4913c76 commit ec5dde7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions secure-standalone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,16 @@ else {
Write-Output "The Optional SimeonOnSecurity Configurations Section Was Skipped..."
}

Write-Host "Checking Backgrounded Processes" ; Get-Job
Write-Host "Performing Group Policy Update" ; Gpupdate /force
Write-Warning "A reboot is required for all changed to take effect"
Write-Host "Checking Backgrounded Processes"; Get-Job

Write-Host "Performing Group Policy Update"
$timeoutSeconds = 180
$gpupdateJob = Start-Job -ScriptBlock { Gpupdate /force }
$gpupdateResult = Receive-Job -Job $gpupdateJob -Wait -Timeout $timeoutSeconds
if ($gpupdateResult -eq $null) {
Write-Host "Group Policy Update timed out after $timeoutSeconds seconds."
} else {
Write-Host "Group Policy Update completed."
}

Write-Warning "A reboot is required for all changes to take effect"

0 comments on commit ec5dde7

Please sign in to comment.