Free ebook: Introducing Microsoft System Center 2012 R2

In Microsoft Press Blog:

SCOM 2012: resolve automatically alerts “Agent proxy not enabled”

An easy solution for resolve automatically the uncomfortable alerts “Agent proxy not enabled”:

Scom 2012 error in UNIX/Linux Computers: An item with the same key has already been added


After I install some UNIX servers, I found the next error when I access to “UNIX/Linux Computers” in the Administration panel:


An item with the same key has already been added

Date: 9/6/201X 19:46:08 PM
Application: Operations Manager
Application Version: 7.0.9538.0
Severity: Error

System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.MonitoringObjectPathToMonitoringObjectDictionary..ctor(IEnumerable`1 monitoringObjects)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.UnixComputerOperatingSystemHelper.JoinCollections(IEnumerable`1 managementServers, IEnumerable`1 resourcePools, IEnumerable`1 unixcomputers, IEnumerable`1 operatingSystems)
at Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.Administration.UnixAgentQuery.DoQuery(String criteria)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.DoQuery(String criteria, Nullable`1 lastModified)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.FullUpdateQuery(CacheSession session, IndexTable& indexTable, Boolean forceUpdate, DateTime queryTime)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalSyncQuery(CacheSession session, IndexTable indexTable, UpdateReason reason, UpdateType updateType)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.InternalQuery(CacheSession session, UpdateReason reason)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Cache.Query`1.TryDoQuery(UpdateReason reason, CacheSession session)
at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent component, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)




During the discovery of one linux server, the first discovery was unsuccessfully because there was not a dns entry for this server. After solving this problem, I launched the discovery process again and the agent was correctly installed and configured. The day after I discover this problem in the operations console.


  1. Execute in the operations manager DB the next query to obtain all UNIX agents:

DECLARE @NeededTypeName NVARCHAR(256) 
DECLARE @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived UNIQUEIDENTIFIER 
SET @NeededTypeName = N'Microsoft.Unix.OperatingSystem' -- Enter the Class on which we are looking for duplicate entries 
SET @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived = ( 
SELECT ManagedTypeId 
FROM ManagedType 
WHERE TypeName = @NeededTypeName 
NULL AS SourceEntityId 
FROM dbo.ManagedEntityGenericView 
SELECT DISTINCT [BaseManagedEntityId] 
FROM dbo.[TypedManagedEntity] TME WITH(NOLOCK) 
JOIN [dbo].[DerivedManagedTypes] DT 
ON DT.[DerivedTypeId] = TME.[ManagedTypeId] 
DT.[BaseTypeId] = @ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived AND 
TME.IsDeleted = 0 
) AS ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived 
ON ManagedTypeIdForManagedEntitiesByManagedTypeAndDerived.[BaseManagedEntityId] = [Id] 
[IsDeleted] = 0 AND 
[TypedMonitoringObjectIsDeleted] = 0 AND 
[ManagedEntityGenericView].[Path] IN ( 
SELECT [BaseManagedEntity].[Path] 
FROM [BaseManagedEntity] 
GROUP BY [BaseManagedEntity].[Path] 
HAVING COUNT([BaseManagedEntity].[Path]) > 1 
ORDER BY [ManagedEntityGenericView].[Path]

2. Export all entries in the “path” column and search duplicate elements using for example excel or notepad ++.

3. If you can access to “Unix/Linux Computers” delete the duplicated objects in the Scom console and rediscover the Server afterwards. This should fix the issue.

What’s happens if you don’t have any element in your “Unix/Linux Computers” in the operation console? you must delete it through Powershell with this command line:


Powershell: create Windows event log

Create a NT eventlog for testing event monitor or rules:

Write-Eventlog -Logname ‘Application’ -Source ‘Hyperion EPMA DimensionServer’ -EventID 0 -EntryType Error -Message “This is a test of Gustavo Mendez (SCOM)”



More information

To write an event to an event log, the event log must exist on the computer and the source must be registered for the event log.

The cmdlets that contain the EventLog noun (the EventLog cmdlets) work only on classic event logs. To get events from logs that use the Windows Event Log technology in Windows Vista and later versions of Windows, use Get-WinEvent.


Find the groups that belongs a Scom agent

# ——————————————————————————————————————–
# Name: Get-GroupsForOneObject.ps1
# Author: Gustavo Méndez, 23/08/2013
# Version: 1.0
# Description: Displays all groups that one Scom agent belongs
# Change value of variable $stringObject by the server name to find
# ——————————————————————————————————————

# Initialize hashtable array (index will be the group name)


# Declare object to find

$stringObject=”Object Name or Server Name”;

# Find and save the Scom object

$Class = get-monitoringclass -name “Microsoft.SystemCenter.Agent”;

$objectToFind = Get-MonitoringObject -monitoringclass:$Class | ? {$_.displayname -match $stringObject}

# If object is null exit

If (!($objectToFind))
write-host “It doesn’t exist or it could be for example a VMware virtual machine server discovered by Veeam MP without Scom agent”;


# Obtain groups

$mg = (Get-ManagementGroupConnection).ManagementGroup;

$groups = $mg.GetRootPartialMonitoringObjectGroups() | sort DisplayName;

# Find the object in each group

foreach ($group in $groups)

$groupMembers = $group.GetRelatedPartialMonitoringObjects([Microsoft.EnterpriseManagement.Common.TraversalDepth]::OneLevel);

# If group contain members…

if($groupMembers.Count -ne 0)


# Compare each member group with the object to find

foreach ($groupMember in $groupMembers)


if ($groupMember.displayname -match $objectToFind)


# Add group to array

$array.$objectToFind += (“$group, “);





$array.GetEnumerator() | Sort-Object Name | Out-GridView; # Print results in a new window;

First steps in Visual Studio Authoring Extensions

  1. MVP Pro Speaker Series:Tips & Tricks to Using the Visual Studio Authoring Extensions:
  2. First steps in Visual Studio Authoring Extensions for System Center 2012 – Operations Manager:
  3. Visio Management Pack Designer for System Center 2012 – Operations Manager (with exercises):

Next the exercises to download:

Operations Manager Management Pack Examples – Health Model:

Operations Manager Management Pack Examples – Service Model:


How can I organize my emails definitely?

Always fighting with my inbox email, last week I decided to resolve this problem. I looked for some good guidelines and finally I found these 2 good resources.

And this video where I have obtained all guidelines for organize my outlook: Outlook Best Practices: How Harry got organized