Recently we were working on an issue where we were getting an error indicating that an agent could not be removed from a Windows Cluster service node. While trying to delete the agent it gave the following error:
“Agent is managing other devices and cannot be uninstalled. Please resolve this issue via Agentless managed view in Administration prior to attempting uninstall again.”
Now you might be thinking that it’s a known issue in OpsMgr 2007 R2 and fixed in Cumulative Update 1 (CU1) of OpsMgr 2007 R2. We also thought the same, but the customer informed us that they had installed CU4 but were still experiencing the issue. That sounded strange since it should have been fixed in CU1, and since CU4 contains all the previous updates we shouldn’t be seeing this error message.
Finally we figured out that we had many remote consoles installed and we were performing the steps from one of the remote consoles which was still running OpsMgr 2007 RTM. When we tried the same steps on the RMS console we were successfully able to delete it, so the moral of the story is that all the consoles should also be updated to the latest CU level when you do your updates.
So that fixed that problem, but how do you discover and update all the machines that have the console installed? I checked with our Configuration Manager team and we were able to create a collection that will list all the machines where the OpsMgr console is installed. Since most people who use OpsMgr also use ConfigMgr 2007 in their environment, and the ConfigMgr agent is installed on virtually all of the managed machines, this post and my solution assumes that all the OpsMgr agents also have the ConfigMgr agent installed.
Since ConfigMgr 2007 is used for Software Inventory and the executable of the OpsMgr 2007 console is “Microsoft.MOM.UI.Console.exe” we were able to make a WQL query for the OpsMgr 2007 console collection as follows:
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName = "Microsoft.MOM.UI.Console.exe"
Now when I checked in my ConfigMgr console it populated as below:
So now whenever I need to path my OpsMgr consoles I can simply go to this view and find out all the machines where it is installed. Also, when we apply a Cumulative Update, lots of DLLs and files get updated as well. For example, let’s say that when we apply CU4 the version changes to 6.1.7221.61 like in the below screenshot:
What we can do is make another collection where we list all the machines on a specific CU level. For that we will need to choose any file with the updated version (in this example it would be 6.1.7221.61). So the collection query specifically for CU4 machines will look like this:
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName like "monitoringhost.exe" and SMS_G_System_SoftwareFile.Fileversion="6.1.7221.61"
In the above example, I choose the file as ‘Monitoringhost.exe’, but you can choose any updated file to create the collection. The collection members look like this:
You can also see this in the OpsMgr console at Monitoring –> Operations Manager –> Agent –> Agents by Version.
In the reverse order, you can also make a collection to find out all the agents that are still not at the CU4 level by using the following WQL query:
SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceId = SMS_R_System.ResourceId where (SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = "System Center Operations Manager 2007 R2 Agent" or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "System Center Operations Manager 2007 R2 Agent") and (SMS_G_System_SoftwareFile.FileName = "MonitoringHost.exe" and SMS_G_System_SoftwareFile.FileVersion != "6.1.7221.61
The query above will populate with all the machines that have the OpsMgr 2007 agent and are not at CU4 level.
Hope this helps,
Vikram Sahay | System Center Technical Lead
The App-V Team blog: http://blogs.technet.com/appv/
The WSUS Support Team blog: http://blogs.technet.com/sus/
The SCMDM Support Team blog: http://blogs.technet.com/mdm/
The ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
The SCOM 2007 Support Team blog: http://blogs.technet.com/operationsmgr/
The SCVMM Team blog: http://blogs.technet.com/scvmm/
The MED-V Team blog: http://blogs.technet.com/medv/
The DPM Team blog: http://blogs.technet.com/dpm/
The OOB Support Team blog: http://blogs.technet.com/oob/
The Opalis Team blog: http://blogs.technet.com/opalis
The Service Manager Team blog: http: http://blogs.technet.com/b/servicemanager
The AVIcode Team blog: http: http://blogs.technet.com/b/avicode
The System Center Essentials Team blog: http: http://blogs.technet.com/b/systemcenteressentials
The Server App-V Team blog: http: http://blogs.technet.com/b/serverappv