Yesterday I received a question about how SCOM 2012 R2 is dealing with renames of servers. Will SCOM create new objects or will it just rename the existing objects. My first short answer was that a rename of a computer object will result in new objects in SCOM. In this blogpost I want to show you ‘prove’ for the fact that new objects are created.
Let’s first start with explaining that we look to 2 objects in this blogpost. We have the Agent object (class instance) and the Windows Computer object (class instance). First lets look into the agent. The class definition of an agent is:
<ClassType ID="Microsoft.SystemCenter.Agent" Comment="represents a Mom Agent, not the OpsMgr Server" Accessibility="Public" Abstract="false" Base="Microsoft.SystemCenter.HealthService" Hosted="true" Singleton="false" />
You can see that the agent has a base class so let’s look to the base class of the agent:
<ClassType ID="Microsoft.SystemCenter.HealthService" Comment="represents a health service and its configration" Accessibility="Public" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false"> <Property ID="AuthenticationName" Type="string" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="MaximumQueueSize" Type="int" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="MaximumSizeOfAllTransferredFiles" Type="int" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="RequestCompression" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="CreateListener" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="Port" Type="int" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="IsRHS" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="IsManagementServer" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="IsAgent" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="IsGateway" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="IsManuallyInstalled" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="InstalledBy" Type="string" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="InstallTime" Type="datetime" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="Version" Type="string" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="ActionAccountIdentity" Type="string" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="HeartbeatEnabled" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="HeartbeatInterval" Type="int" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="ActiveDirectoryManaged" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="ProxyingEnabled" Type="bool" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="PatchList" Type="string" Key="false" CaseSensitive="false" MinLength="0" MaxLength="256" /> <Property ID="Protocol" Type="string" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" /> <Property ID="InitiatesConnectionToParent" Type="bool" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" /> <Property ID="ThirdPartyAuthenticationUri" Type="string" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" /> </ClassType>
You see here all the properties we have on a agent and the Health service of that agent. The strange thing to mention is that the Health Service class does not have a key property. Normally SCOM decides based on the key property if a new object must be created. So let’s look into the Windows Computer object.
<ClassType ID="Microsoft.Windows.Computer" Base="System!System.Computer" Accessibility="Public" Hosted="false" Abstract="false"> <Property ID="PrincipalName" Type="string" Key="true" CaseSensitive="false" /> <Property ID="DNSName" Type="string" /> <Property ID="NetbiosComputerName" Type="string" /> <Property ID="NetbiosDomainName" Type="string" /> <Property ID="IPAddress" Type="string" /> <Property ID="NetworkName" Type="string" /> <Property ID="ActiveDirectoryObjectSid" Type="string" /> <Property ID="IsVirtualMachine" Type="bool" /> <Property ID="DomainDnsName" Type="string" /> <Property ID="OrganizationalUnit" Type="string" /> <Property ID="ForestDnsName" Type="string" /> <Property ID="ActiveDirectorySite" Type="string" /> <Property ID="LogicalProcessors" Type="int" /> <Property ID="PhysicalProcessors" Type="int" /> <Property ID="HostServerName" Type="string" /> <Property ID="VirtualMachineName" Type="string" /> <Property ID="OffsetInMinuteFromGreenwichTime" Type="int" /> <Property ID="LastInventoryDate" Type="datetime" /> </ClassType>
The Windows Computer object do have a key property which represents the name of the computer object. Based on this key property a rename of a Windows Computer will result in a new object in your SCOM environment. So lets try it out! 🙂
I have a Windows server which I will use in this test:
This server has the following ID’s in the database:
and
The results of the above query shows the ManagedEntityId’s of both objects.
Now it’s time to rename the computer and let’s look what happens. So I renamed my test server from CONTOSO-TST01 to CONTOSO-TEST01.
After the change I checked my Active Directory and the computername was also changed in the Active Directory. But what happens inside SCOM:
The first thing to notice is that the Agent will go into a ‘gray’ state:
So this means that the current agent is not monitored. But how do we get the renamed server back into monitoring. If we look in the Pending Management section we see a ‘new’ installed agent:
The first step is to approve the new server. When the server is approved it will become monitored inside the SCOM environment with the new name. Also notice that the ‘old’ server is still there and not automatically deleted from the SCOM environment:
and the Windows.Computer object:
Based on the above screenshots we can conclude that new objects are created in case of a rename of the server. We also see this in the database:
and
Conclusion:
When an server is renamed new object with different IDs are created in the SCOM environment. You also have to manually delete the ‘old’ agent from you SCOM environment.