There may come a time where a SCOM agent is no longer communicating with its Management Server. Some organizations may allow the monitoring team to log into the server that has the agent communication issues and clear the Health Service State folder. For hardened environments, that may pose to be an issue. Through orchestrator, we can specify an account variable already in place.
Runbook Overview
-
Initialize Data. – When running the runbook this is where the name of the Agent will be provided.
-
Stop Health Service – The service will need to be stopped before the folder can be renamed. Under the Security tab, I am using credentials that have the rights necessary to perform the actions against the service.
-
Rename Health Service Folder – A simple script will run to change the name of the folder. Grab my script here. The script uses variables I have stored in Orchestrator to rename the folder. Change out the SERVERNANE place holders with the Variable for the Computer Name. Also in the script change out the $Username and $Password with the variables of the account that is used for the connection. As a recommended practice the password variable should be encrypted.
-
Start Health Service – This will restart the service and create a new folder automatically.
Results: