ConfigMgr and PowerShell - the RepairClient Method

Here's an example of a handy function to initiate a client repair remotely using PowerShell:

function repairclient([String] $strComputer)
{
    $SMSCli = [wmiclass] "\\$strComputer\root\ccm:sms_client"
    $SMSCli.RepairClient()
}

 

Launch PowerShell, paste this function at the prompt (you may have to hit return once or twice to get back to your command prompt), and as long as you're in this PowerShell session, you can run the command as follows:

repairclient COMPTUER1

(where COMPUTER1 is the remote computer to repair).

** This will run with the same rights as your PowerShell session, which must have proper rights to remotely call this WMI method.

Published Tuesday, June 17, 2008 5:58 PM by gramsey
Filed under: ,

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems