Restart Windows Computer Remotely Through a SCOM Agent Task

Restart Windows Computer Remotely Through a SCOM Agent Task

One of the needs of my customer was to be able to reboot any Windows computer (with SCOM agent) remotely without having local administrator rights. I figured out that the best way to accomplish this would be to create a SCOM agent task (not a console task), that you can call from anywhere (script, runbook, etc.). The main advantage is that tasks run under the credential of the Default Action Account on the agent computer. This account typically has sufficient privileges for accessing most application components and running actions, even if the user running the tanks does not have these user rights.

To create this agent task you can use your favorite tools, in my case I will create this task in a new Management Pack fragment on my visual studio solution. You can find below the XML source code for this agent task.

Once you have imported your management pack containing this agent task, you can launch the task from one of your MS for example, through these PowerShell lines.

You will have an associate output in your Powershell windows with the status of the task. You can also retrieve the information directly in the Task Status view on your SCOM console.

Leave a Reply

Your email address will not be published. Required fields are marked *