Skip to content

Instantly share code, notes, and snippets.

@gilrim
gilrim / win-updates.ps1
Created March 15, 2018 15:10 — forked from joefitzgerald/win-updates.ps1
Install All Windows Updates, Rebooting As Many Times As Required
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=10)
function Check-ContinueRestartOrEnd() {
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$RegistryEntry = "InstallWindowsUpdates"
switch ($global:RestartRequired) {
0 {
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
<#
.SYNOPSIS
Written by JBear
.DESCRIPTION
Before use -- set the following values to your own environment information:
Line 59, 65, 71, 77, 85
This script/function is designed to retrieve all windows services being run by any service accounts (not including standard defaults - see lines 142-148 to adjust). This is to assist SysAdmins in finding all service accounts currently in operation during password change timeframes.
All switches ( currently -S -K -W -H ) may be linked to their respective OU.

Keybase proof

I hereby claim:

  • I am gilrim on github.
  • I am gilrim (https://keybase.io/gilrim) on keybase.
  • I have a public key whose fingerprint is B76D D1F4 4735 2E74 2385 D8C5 F7E8 C01A 8E13 1560

To claim this, I am signing this object: