Powershell script to refresh SCCM client machine policy

I’ve been working with SCCM for a few months.  As some might know, forcing SCCM to “test now” is a bit of a process.   Here is a script I use to force the client to check for new advertisements.  It’s been handy when performing testing.  Hope you find this helpful

Refresh-SCCMClientMachinePolicy.ps1

$Computer = “.”
$Class = “SMS_Client”
$Method = “TriggerSchedule”
$Sched = “{00000000-0000-0000-0000-000000000021}”
$MC = [WmiClass]”\$ComputerROOTccm:$Class”

$InParams = $mc.psbase.GetMethodParameters($Method)

$InParams.sScheduleID = $Sched

“Calling SMS_Client. : TriggerSchedule with Parameters :”
$inparams.PSBase.properties | select name,Value | format-Table

$R = $mc.PSBase.InvokeMethod($Method, $inParams, $Null)
“Result :”
$R | Format-list

Here is a screenshot of how you refresh the Machine Policy on the client.  This forces the client to check for new policy (aka Advertisements).

Thank you,

Steve Schofield
Windows Server MVP – IIS
http://www.iislogs.com/steveschofield

http://www.IISLogs.com
Enteprise Log management solution
Install, Configure, Forget

Questions on Microsoft SMTP Service – visit http://www.smtp.ws
IIS Community Newsletter – visit http://www.iisnewsletter.com