Integrating PowerShell DSC with ITSM/Change Management

83 views Asked by At

We are in the process of implementing DSC in our organization. We are able to create and deploy configurations successfully in our non-prod test environment.

Before we implement DSC in PROD environment, our management need to integrate this with ITSM/Change management. So that everything has a Change Ticket (we are using ServiceNow). We can take care of this during the creation and deployment of DSC Configurations.

However, the actual problem is when DSC Configuration is deployed and it is in action. How do we integrate the ITSM/Change management and logging mechanism?

Let me give an example, suppose we have SERVER1 for which we have created a configuration to make sure that ‘TapiSrv’ is always in ‘Stopped’ state. Now due to some requirement user X has created a change ticket to Start this service. He has started the service as per the Change Ticket successfully. Now, when the LCM triggers DSC Configuration to restore the service to it’s original state i.e. ‘Stopped’. User don’t have a clue why this has happened and we don’t have any Change ticket before LCM restores the service to it’s original state. This change was happened without a Change Ticket or any logging mechanism.

Can we integrate some code to be executed before LCM restores/reverts the changes made to the Service so that we can do two things, create a Change Ticket programmatically and creating a DB entry before actually restoring the configuration.

We can take care of writing code to create a change ticket and making DB entry but how we can trigger that code before LCM restores the configuration.

This will also help us generate a report about how many times the server drifted from the configuration and LCM has restored it back.

I don't know how to trigger some code before LCM brings anything back to it's original state.

1

There are 1 answers

1
Wena On

You can do this by having LCM in consistency check only and then when reports arrive at your db connected to dsc server you create ticket, after procesing change ticket you will just invoke dsc apply manualy.