PoshCode Archive  Artifact [473c8db039]

Artifact 473c8db0392232dd6720fba988b2a822e3f87bce023565adf6fd6085a9032a10:

  • File Force-WSUS-Check.ps1 — part of check-in [1486127abe] at 2018-06-10 13:40:15 on branch trunk — Remotely force WSUS Check on Servers within your network. Powershell remoting must be enabled. (user: St3v3o size: 750)

# encoding: ascii
# api: powershell
# title: Force WSUS Check
# description: Remotely force WSUS Check on Servers within your network.  Powershell remoting must be enabled.
# version: 0.1
# type: script
# author: St3v3o
# license: CC0
# x-poshcode-id: 4385
# x-archived: 2015-12-08T19:46:14
# x-published: 2015-08-12T18:12:00
#
#
# Powershell Script to force clients check into WSUS server

# Import Active Directory PS Modules CMDLETS
Import-Module ActiveDirectory

$comps = Get-ADComputer -Filter {operatingsystem -like "*server*"}

$cred = Get-Credential

Foreach ($comp in $comps) {

Invoke-Command -computername $comp.Name -credential $cred { wuauclt.exe /detectnow }
Write-Host Forced WSUS Check-In on $comp.Name

}