Initiate client policy retrieval by using script

1665

Initiate client policy retrieval by using script – In this short post we will see how to Initiate client policy retrieval by using script. A Windows Configuration Manager client downloads its client policy on a schedule that you configure as a client setting. However, there might be occasions when you want to manually initiate policy retrieval from the client. For example, in a troubleshooting scenario when you have deployed a software to a collection or when you are testing. You could actually initiate client policy retrieval using the Actions tab on the Configuration Manager client but the script will also help you out. You must be logged onto the client computer with local administrative rights to perform these procedures.

The below script is taken from Technet. Copy the script into a notepad and save the file with filename.vbs extension.

In case you want to download the script click this link.

Initiate client policy retrieval by using script

On the client computer, run the file using one of the following methods:

a) Navigate to the file by using Windows Explorer, and double-click the script file. Click OK in the Windows Script Host dialog box.

Initiate client policy retrieval by using script

b) Open a command prompt, and type: cscript <pathfilename.vbs>.

Initiate client policy retrieval by using script

  • Rohin McDermott

    VBS?? Why not PowerShell? Isn’t this the equivalent?

    $CPAppletMgr = New-Object -ComObject CPApplet.CPAppletMgr
    $ClientActions = $CPAppletMgr.GetClientActions()
    ForEach ($ClientAction in $ClientActions) {
    Write-Host “Performing action $($ClientAction.Name)”
    $ClientAction.PerformAction | Out-Null
    }

    You could put a where or an if in there if you just want particular policies to run.

    • Yes you can run the powershell script as well. I just showed the example by running vbscript. I haven’t tested the powershell script yet, I will do it and if it works fine I will update the post or create a new one.
      Thanks for the feedback 🙂