How to Stop Configuration at target Nodes – part 10

This is tenth and last part of 10 series blog on LCM APIs and Internals. In last part, we saw “How to Test and re-apply Configuration at target Nodes” using three different methods, namely WMI, CIM and DSC Cmdlet.

In this post, we will continue our journey and would see “How to Stop Configuration at target Nodes” using the same three methods.

DSC LCM also provides with a method named “StopConfiguration” whose purpose is to stop any configuration that is in process of applying the configuration. There is no equivalent DSC Cmdlet for this method. Also, I have not seen any practical usage of this method since configurations are normally applied within seconds and we can roll back the configuration if the configuration is not acting as intended. It returns a ReturnValue parameter. A value of Zero signifies that either no configuration was in progress or it was able to stop the configuration. Any non zero value signifies an error and the configuration application could not be stopped.

Windows Management Instrumentation (WMI)

We can use WMI Cmdlet to test and apply the Configuration. We can see in Image below that we are invoking a WMI method named “StopConfiguration” on class “MSFT_DSCLocalConfigurationManager” available in WMI namespace “ROOT\Microsoft\Windows\DesiredConfigurationManager”.

LCM-10-01

The result of executing the above command results the below. The important thing to note that the ReturnValue is Zero meaning success.

LCM-10-02

Common Information Model (CIM)

All the steps remain same with that of WMI however the only difference is using a CIM cmdlet instead of WMI cmdlet and parameters are sent as hashtable.

LCM-10-03

The result of executing the above command results the below. The important thing to note that the ReturnValue is Zero meaning success

LCM-10-04

Hope this Post helps!

Cheers!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s