PoshCode Archive  Artifact [554fea565d]

Artifact 554fea565df1f799c7ee4f0b3221fda878cb7b49ce34e022d26d3728eced3414:

  • File Force-WSUS-Check.ps1 — part of check-in [805a8644c9] at 2018-06-10 13:04:43 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: 2074
# x-archived: 2017-05-15T14:28:06
# x-published: 2011-08-16T09:15: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

}