none
Changing primary management server in SCOM console doesn't change in managed node properties RRS feed

  • Question

  • Hi Team,

    We are moving a bulk of servers from one management server to newly Azure migrated management server. After we change the server name in the managed node -> control panel - Microsoft monitor agent then the status becomes healthy. 

    Why is this happening and also let me know how can I do this for a bulk of servers. 

    Friday, August 16, 2019 2:01 PM

All replies

  • Hi,

    not sure if I got this right: You are changing the management server in the agent settings...from the old management server to a new management server, which is installed in Azure. After changing the management server the agent gets Healthy?  Is this correct?

    Questions:

    Does this mean that existing agents in Critical or Warning state also change to Healthy?
    Is the new Management Server part of the same management group?
    Is the new management server also "Healthy", does it exchange cnfiguration information with the rest of the management servers in the same management group?

    If the new management server is part of a new management group then most probably you don't have agent state information in the database yet or you don't have the same monitors, like in the old environment. Could that be the case?

    Thanks for clarifying and Regards,

    Stoyan


    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov


    Friday, August 16, 2019 2:10 PM
    Moderator
  • I guess you meant "becomes unhealthy"?

    Could be because there is an issue communicating to the MS in Azure, check that port 5723 is open from agent to MS.

    And also check for any error event in event viewer > operations manager for these agents.

    If you need to move them in bulk, you can use powershell or scom console : 

    https://docs.microsoft.com/en-us/powershell/module/operationsmanager/set-scomparentmanagementserver?view=systemcenter-ps-2019

    http://myscnotes.blogspot.com/2012/07/changing-management-servers-for-scom.html (use shift-click to select multiple agents)

    Friday, August 16, 2019 2:13 PM
  • I have changed the primary management server using "change primary management server" option in scom console. In the console, server got moved to new MS in scom console but it turns greyed out. Once I update the new MS name in the control panel properties of the managed node, then the status turns healthy. I used below command to update the primary management server but I get error. 

    Set-SCOMParentManagementServer -Agent (Get-SCAgent -Name "as.hq.com") -PrimaryServer (Get-SCManagementServer -Name "abc.hq.com")

    Get-SCAgent : The term 'Get-SCAgent' is not recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:40
    + Set-SCOMParentManagementServer -Agent (Get-SCAgent -Name "as.hq.com ...
    +                                        ~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Get-SCAgent:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException


    Friday, August 16, 2019 2:30 PM
  • > New MS belongs to same management group. 

    > Not all the servers in the New MS is unhealthy. Only few are unhealthly, which means once we moved the servers to new MS using scom console"change primary managemt server" option, even the agent properties got changed(inside the manged node). 

    How can I change this primary MS name for 50+ servers using powershell. 

    Friday, August 16, 2019 2:44 PM
  • > New MS belongs to same management group. 

    > Not all the servers in the New MS is unhealthy. Only few are unhealthly, which means once we moved the servers to new MS using scom console"change primary managemt server" option, even the agent properties got changed(inside the manged node). 

    How can I change this primary MS name for 50+ servers using powershell. 

    Hi,

    the PowerShell code you pasted is correct except for the Get-SCxxxxxxx cmdlets....

    When you work with SCOM, you can replace "SC" with "SCOM" and you will have:

    Get-SCOMAgent

    and

    Get-SCOMParentManagementServer

    and that will work. Here even a better example from Kevin Holman, including more details:

    Assigning Gateways and Agents to Management Servers using PowerShell

    Please paste back with the outcome...

    Regards,



    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov



    Friday, August 16, 2019 3:00 PM
    Moderator
  • Command got executed when I changed SC to SCOM, but no changes inside the manged node. Agent properties remains blank. 

    Please guide me. 

    Friday, August 16, 2019 3:33 PM
  • Do I need to give service account credentials?
    Friday, August 16, 2019 4:11 PM
  • The most likely cause of your errors is that you are orphaning agents.

    You cannot change an agent to a new management server using Powershell, without providing the "failover" to include the old management server.  Otherwise the old management server will reject the agent (since it is not in the allowed failover list) and the agent never gets updated config, to tell it about the new MS.

    In order to do what you want, you need to ensure that ALL management servers are available for failover by reviewing that for a sample in PowerShell, then change the primary in the console (or use PowerShell and empty out the failover, change the Primary to a new server, then populate the new Failover List.)

    If you have a Management server on Prem, and have a Management server in Azure, that is most likely unsupported.  We require that management servers must be less than 5ms (optimally, no more than 10ms) in network latency to the SQL databases AND each other.  This most likely won't be possible in your configuration.

    The proper way to migrate to an Azure hosted SCOM deployment, is to build a totally new SCOM deployment in Azure  then multi-home to migrate, or to shut down the on prem environment, lift and shift the VM's to Azure, and bring them up there using the same names and domain memberships.... nothing changes except the IP addresses.


    Kevin Holman https://kevinholman.com/

    Saturday, August 17, 2019 7:14 PM
    Moderator
  • I saw kevin's response to this post later Unable to find it :( 
    Tuesday, August 20, 2019 2:04 PM
  • I saw kevin's response to this post later Unable to find it :( 

    Hi,

    did you resolve this one? Were the answers helpful? 

    We would really appreciate your feedback. Thanks in advance!

    Regards,


    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov

    Friday, September 13, 2019 9:05 AM
    Moderator