Blog
By Tommy Gunn on 8/12/2009 5:11:31 PM • Rank (4287) • Views 4570
0

0

In Part 1 on this topic, we took a look at how to access client data through the Site Server (effectively from the database). As it turns out, the ConfigMgr client is remotely accessible as well using WMI (WMI via Powershell in this case). There are actually some important use case scenarios in which manipulating client remotely to override default behavior of the client behavior.

Let’s consider a scenario in which we need to rollout software very quickly, and thus need to force the client to check for software advertisements quickly. This can be achieved by forcing the client to request and evaluate Machine Policy. We can do this quite easily with a couple of lines of Powershell and the right methods from the SMS_Client WMI class.

We’ll start by connecting to a remote client and assigning to a variable (replace servername with the name of the target server)

$SCCMClient = [wmiclass] "\\servername\root\ccm:sms_client"

Next, we will enumerate the available properties and methods to see what options we have available. Output is shown in the screenshot below

$SCCMClient | Get-Member 

image

 

 

 

 

 

 

 

 

The methods of interest to meet the objectives of this scenario are RequestMachinePolicy and EvaluateMachinePolicy. In other circumstances, RepairClient could be interesting, but we will discuss that another time.

Force Client to Request and Evaluate Machine Policy

In order to force the client to retrieve and evaluate Machine Policy, we need to connect to the client through WMI and call the RequestMachinePolicy and EvaluateMachinePolicy methods. This is easily done with the three lines of Powershell script below.

$SCCMClient = [wmiclass] \\servername\root\ccm:sms_client
$SCCMClient.RequestMachinePolicy()
$SCCMClient.EvaluateMachinePolicy()

 

Conclusion

That’s all for now. In part 3, we’ll look at more options available for managing the client, as well as how to execute commands against large numbers of clients.

 

 

 

Map Location


GPS Latitude: 0.00000 Longitude: 0.00000
Comments - Comment RSS


Who Viewed
Who Reviewed
Categories
Related Pages
Shortened URL
http://tinyurl.com/qt5sbq

Top Contributors
Featured Members
Pete Zerger
Points: 65622
Level: System Center Expert
Tommy Gunn
Points: 42748
Level: System Center Expert
Simon Skinner
Points: 40804
Level: System Center Expert
Stefan Koell
Points: 28999
Level: System Center Expert
Andreas Zuckerhut
Points: 27734
Level: System Center Expert