Monday, November 4, 2013

Using SCCM 2012 Compliance Settings to update license files

when you are using licensed applications, some of them require locally present license files and this files needs to be updated once in a while. one way to do it is just to push the new license file to all clients and go drink some coffee...
... but there is a more intelligent way to achieve this goal through utilizing Compliance Settings in SCCM 2012...

... So, lets take a look on how to update Immidio Flex+ license from SCCM 2012 utilizing Compliance Settings feature.

if you are wondering what Configuration Settings feature is, take a look on this TechNet article.
BTW in SCCM 2007 it was called Desired Configuration Management ;)
i'm not going to explain Configuration Settings in detail, because there are already a lot of people who spent enough time doing it, for example guy's from Windows Noob. The important thing for this article is what Compliance Settings can and can't remediate.
Compliance Settings can only remediate Registry, Script and WMI.
REMEMBER - remediation is only supported for "Equal" Operator. If you set operator other than ‘Equal’ the remediation option will disappear.
This TechNet forum post contains good explanation on can and can't do topic.

Beacuse we cannot remediate file, we'll have to create collection, based on compliance status, and deploy new license file to that collection.


The approach is simple:
- create Configuration Items and Configuration Baseline.
- deploy that baseline to a device collection.
- create query based collection that includes all non-compliant devices.
- deploy new license file to the collection containing non-complient clients.

Disclamer - this post assumes the reader has got basic knowlege of SCCM 2012 and has access to properly configured and working SCCM 2012 site with software distribution and (custom) client settings etc.

Create Compliance Settings:

Create  Configuration Item
in Configuration Manager Admin Console go to "Assets and Compliance"->"Compliance Settings"
click on "Configuration Items" and select "Create Configurattion Item" on the ribbon.



On the General page of the New CI Wizard call it Configuration Iten "[CI] Flex+ license" and click on "Summary" and "Next"





Now we've got the new Configuration Item in console


double click on the newly created Configuration Item, go to "Settings" tab and click on "New"


configure the settings on the General tab as shown on the screenshot below and click on OK





NOTE - The path is target dir where the license file is located on the clients. In this case it is the installation folder for Immidio Flex+.

now, switch to the Compliance Rules tab and create two colpliance rules.





1-st rule will check if the license file exists
NOTE - this rule might not seem to be really necessary, but some times you want to verify if the clients has got the license file at all.



and the second rule will check the creation date of the license file



NOTE - for this sample i'm using two Flex+ demo license files, one of them was created on 2013.10.25 and another one a few days before. For this example the new file has to replace the old one somehow.

Create Configuration Baseline
in Configuration Manager Admin Console go to "Assets and Compliance"->"Compliance Settings"
click on "Configuration Baseline" and select "Create Configuration Baseline" on the ribbon.



provide the name of the Configuration Baseline
click the "Add" button and select "Configuration Item" from drop-down menu




in the Add Configuration Items wizard select [CI] Flex+ license Configuration Item we've preveously created, click "Add" and then "OK".

After "Configuration Baseline" has been created, deploy it to you target collection. Deployment process is the same as for anything else in SCCM 2012 - just right click on the thing you what to deploy and choose "Deploy" option ;)

before we'll proceed add "CI ID" field to the view in Configuration Baselines section. we'll need it later to create the collection query




Create Collection:

now that we've got Configuration Baseline created and deployed and assuming that enougth time/effort passed to get the baseline to the clients, evaluate it and report back to the SCCM site...
we'll create device collection based on evaluation results which will contain all the clients

create device collection
in this case i've named it  "[software] Immidio Flex+ 8.1 license update", but feel free to use any other name :D



the most important part of this collection is the query-based membership rule
in the Membership Rules  step of the wizard click on "Add Rule" and select "Query Rule" from the drop-down menu


give your query a name and click on "Edit Query Statement"



 switch to the "Criteria" tab and add two query criteria

1-st criteria will be our Configuration Baseline's "CI ID"

in the "Criterion Properties" click on "Select" button 



and set "Configuration Item Compliance State" as "Attribute Class" and "CIID" as value.



after clicking on the "OK" we are back in "Criterion Properties"
remember that we've added "CI ID" field to the "Configuration Baseline" window view? this is the place where we need those 8 digits.
NOTE - do not forget to replace CI_ID value with the correct CIID from your environment!




2-nd criteria will be our Configuration Baseline's "Compliance State"





Optionally, you can just click on "Show Query Language" button



and paste the query below into it.

select *  from  SMS_R_System inner join SMS_G_System_CI_ComplianceState on SMS_G_System_CI_ComplianceState.ResourceId = SMS_R_System.ResourceId where SMS_G_System_CI_ComplianceState.CI_ID = 16811141 and SMS_G_System_CI_ComplianceState.ComplianceStateName = "Non-Compliant"

NOTE - do not forget to replace SMS_G_System_CI_ComplianceState.CI_ID value with the correct CIID from your environment!

Deploy license file:

This part doesn't differ from any other software deployment activity.
just create a software package, containing the license  file you want to deploy or update, and script to do the job and you are done.

after some time, depending on collection evaluation time, client policy settings etc, we'll see the license file being updated where necessary.

No comments:

Post a Comment