Skip to content
adatum
  • Home
  •  About adatum
  •  Learn Azure Bicep
  •  SCOM Web API
Operations Manager

Clone a VM with OpsMgr agent

  • 25/06/201507/01/2025
  • by Martin Ehrnst

Just a short post, and a reminder to my self.

From time to time, you will need to clone a virtual machine, and put this clone in to production. So you Clone, you sysprep, change all it’s configuration and add it back to the domain. So what happens to the OpsMgr agent part of all this?

For the first, you will have a new agent/computer available in your console with the new name. But this agent won’t be able to download any configuration. This is shown by this alert: “Health Service unable to process new configuration” and the agent state for this computer will be shown as critical

If you experience this, you could uninstall the agent, delete it from the console and install everything again, but. What you also could do,

MMC > Certificates > Local Computer > Operations Manager – The certificate is issued to the old computer (yes of course, it is a clone). So instead of uninstall, just stop the healthservice.exe (Microsoft Monitoring Agent), delete the certificate and start the agent back up. And everything should be working as expected.

And next time, uninstall the agent on the clone 🙂

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Operations Manager

Schedule maintenance mode for group (easy)

  • 08/06/201507/01/2025
  • by Martin Ehrnst

One of the most annoying things whit System Center Operations Manager is the lack of maintenance mode scheduling built in. (You have some options, with Orchestrator, SCCM etc). One thing I personally struggle with, is to maintenance mode every server during Windows Update since we use WSUS for patching and not SCCM. but that’s not the purpose of this post.

In this post, i will guide you through how you can schedule maintenance mode for a (SCOM) group of computers with tools you already have installed – Powershell and Task Scheduler. In our environment we have some Citrix XenApp servers which are scheduled to reboot every night. Since they boot at the exact same time they are easier to maintenance mode than all other servers that boot randomly during updates.

This post will guide you through the following.

  • Create a dynamic group containing the servers (I will use OU in this example, but you are free to use what ever you like)
  • The Powershell script to run against OpsMgr
  • Configuration of the Scheduled task.

Creating the dynamic group

Under Authoring in your console, create a new group. I have called mine “Citrix Servers” stored in a custom management pack. Under dynamic members you will have to create a formula to populate the group members. Her you can choose the solution that fit your needs, but I will be using OU, as our Citrix servers are stored in their own OU.

Dynamic group based on OU
Dynamic group based on OU

( Object is Windows Computer AND ( Organizational Unit Matches wildcard *OU=Citrix* ) AND True )

If you have some servers in the same OU, that you do not want included in this group. You can add them in the “exculded members” pane. Once your group is created, allow for the “System Center Minute” to complete, and if everything is OK, you should see your servers.

TIP: Finding a coumputers OU. Check its Properties under Windows Computers

 

The Powershell script and task

Since were not allowed to start maintenance mode ahead in time, we have to rely on our favorite automation tool called Powershell. In the OpsMgr module there is a Cmdlet, Start-ScomMaintenanceMode, which have a time variable.

Start-MaintenanceMode on technet

param($ManagementServer, $GroupName, $Minutes, $Reason, $Comment)

Import-Module OperationsManager #Import the opsmgr module
New-SCOMManagementGroupConnection -ComputerName $ManagementServer #connect to MS
$SCOMGroup = Get-SCOMGroup | where {$_.DisplayName -like "$GroupName"} #Get the scom group to maintenance
$Time = ((Get-Date)).AddMinutes(($Minutes)) #get time and date. Add minutes. This will be how many minutes object is in maintenance mode
Start-SCOMMaintenanceMode -Instance $SCOMGroup -EndTime $Time -Reason "$Reason" -Comment $Comment
-Command "z:\path\script.ps1 - ManagementServer 'ManagementServerFQDN' -GroupName 'GroupDisplayName' -Minutes 'XX' -Reason 'YourReason' -Comment 'YourCommentHere' ; exit $LASTEXITCODE"

Creating the task

Start by creating a new Scheduled task. Under triggers, set the time and all other configuration you will need.

Under ‘actions’ browse to system32 and add powershell as the program to run. (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) Under arguments, edit to fit your needs and paste in the above.

Reasons accepted

— PlannedOther
— UnplannedOther
— PlannedHardwareMaintenance
— UnplannedHardwareMaintenance
— PlannedHardwareInstallation
— UnplannedHardwareInstallation
— PlannedOperatingSystemReconfiguration
— UnplannedOperatingSystemReconfiguration
— PlannedApplicationMaintenance
— ApplicationInstallation
— ApplicationUnresponsive
— ApplicationUnstable
— SecurityIssue
— LossOfNetworkConnectivity

Verify that everything works as expected

Event Viewer

mainteventID

Operations Console

MaintFinish

 

Hope this get you on your way to schedule maintenance mode. When I decide to use SCCM to do our patching, or we come up with another idea, I will let you know.

As always – complete this in your test environment to confirm it’s working.
PS: Operations Manager 2016 will have scheduling built in.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Operations Manager

First look at SquaredUp’s new Visio plugin

  • 30/04/201507/01/2025
  • by Martin Ehrnst

A short while ago i implemented SquaredUp – a dashboard solution for OpsMgr in the company i work for. A few days ago, they released a new version (2.1) which includes a new Visio plugin. In short, this plugin allows you to add Monitored Objects to your Visio diagram, and show it’s health state the way you like it.

In this short write up i will show you how i created one of our wall monitors. But the first thing you need is SquaredUp installed (download and test :).

In MS Visio, start out with a basic diagram, or one of your existing ones. This is my start.

SUapp

Next, you will have to add data to your shapes. SquaredUp relies on Object ID from OpsMgr. You can find this, either through Powershell or maybe it is easier to navigate to the object in Squared Up, since thats where you already are. Label: ScomID, value: <yourscomid>
Repeat this for all your objects you want to display.
(PS: if you have all your objects in a group, you can export group members from SquaredUp, and import to visio)

SUShapeData

After all this is done. Export your Visio drawing in to .SVG. Now you create a new dashboard in SU with a Visio section. You can choose to color replace, or add an icon (which you also could with image plugin)
suvisio suvisiocolor

 

After all is done. This is how our dashboard look like. Exchange all green

suappdash

 

The possibilities are “endless” this is how our wall monitor look like. The green shade represent the overall group state.

SUCloud

 

 

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit

Posts pagination

1 … 10 11 12

Popular blog posts

  • SCOM Alerts to Microsoft Teams and Mattermost
  • How to move Azure blobs up the path
  • Creating Azure AD Application using Powershell
  • SCOM and OMS: The agents
  • Azure Application registrations, Enterprise Apps, and managed identities

Categories

Automation Azure Azure Active Directory Azure Bicep Azure DevOps Azure Functions Azure Lighthouse Azure Logic Apps Azure Monitor Azure Policy Community Conferences CSP Monitoring DevOps GitHub Guest blogs Infrastructure As Code Kubernetes Microsoft CSP MPAuthoring OMS Operations Manager Podcast Powershell Uncategorised Windows Admin Center Windows Server

Follow Martin Ehrnst

  • X
  • LinkedIn

RSS feed RSS - Posts

RSS feed RSS - Comments

Microsoft Azure MVP

Martin Ehrnst Microsoft Azure MVP
Adatum.no use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Cookie Policy
Theme by Colorlib Powered by WordPress