# 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

}
