locked
Removal of old SCSM management servers RRS feed

  • Question

  • Hello,
    We have successfully migrated SCSM off of hardware and into a virtual environment with new systems. But now I need to clean up the Management Group, it is still showing some of the old servers. I have followed the steps in this link Dealing with Mutiple Management Servers, but the PowerShell script to remove them is not working. I have tried running it from the console as well as the ISE and keep getting an error "get-scsmobject : Cannot bind argument to parameter 'Class' because it is null.

    import-module smlets
    
    $class = get-scsmclass Microsoft.SystemCenter.ManagementServer$
    
    $ms = get-scsmobject –class $class –filter “displayname = sm12-ms02.sc.net” (name of your MS here)
    
    $ms | remove-scsmobject –force
    

    I have run the sql queries and it shows the old management servers in the group with the new ones.

    Any assistance with this issue would be appreciated.

    Karen

    Wednesday, May 18, 2016 3:05 PM

Answers

  • Hi Karen,

    if you just enter $class, after you have declared the variable with

    $class = get-scsmclass Microsoft.SystemCenter.ManagementServer$"
    it will most probbaly have no value. This means that you are unable to get the class properly.

    Try getting another class in SCSM? Does this work? Try using the Entity Explorer to check on the classes:

    SCSM Entity Explorer

    You have to somehow narrow down the cause for not being able to get the class...

    Hope this helps. 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!)

    • Proposed as answer by Yan Li_ Friday, May 27, 2016 6:52 AM
    • Marked as answer by Yan Li_ Wednesday, June 8, 2016 8:46 AM
    Wednesday, May 25, 2016 12:17 PM

All replies

  • HI Karen,

    make sure your $class variable has a value. The error indicates that you are not getting the value properly (Get-SCSMClass) and because of this your argument -class has a null value.

    Have you installed the smlets properly? Here is the link to the smlets:

    SCSM PowerShell Cmdlets

    Please make sure those are installed and properly imported, then try again. Check the value of $class before passing it to Get-SCSMObject.

    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!)



    Wednesday, May 18, 2016 3:43 PM
  • The SMLets are installed on both the Primary server and my workstation. I have attempted to run it from within the Service Manager console, ISE running as admin, and even created a batch file to kick it off. But no go

    Karen

    Wednesday, May 18, 2016 7:47 PM
  • Hello,

    What is the result when you run command as below:

    import-module smlets

    $class
    = get-scsmclass Microsoft.SystemCenter.ManagementServer$

    $ms
    = get-scsmobject class $class

    Do you have the old management server list there? If not, it seems like that the old management server is already not recognize as a management server.

    I would like to suggest you also go through your event log on both the new and old management server to check is there any warning or errors, make sure after migrating, your management group works without issue.

    Regards,

    Yan Li


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, May 19, 2016 2:42 AM
  • I get the following 
    Get-SCSMObject : Cannot bind argument to parameter 'Class' because it is null.
    At line:3 char:29
    + $ms = Get-SCSMObject -class $class
    +                             ~~~~~~
        + CategoryInfo          : InvalidData: (:) [Get-SCSMObject], ParameterBindingValidationExcepti 
       on
        + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,SMLets.GetSMObjectCom 
       mand

    Wednesday, May 25, 2016 11:51 AM
  • Hi Karen,

    if you just enter $class, after you have declared the variable with

    $class = get-scsmclass Microsoft.SystemCenter.ManagementServer$"
    it will most probbaly have no value. This means that you are unable to get the class properly.

    Try getting another class in SCSM? Does this work? Try using the Entity Explorer to check on the classes:

    SCSM Entity Explorer

    You have to somehow narrow down the cause for not being able to get the class...

    Hope this helps. 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!)

    • Proposed as answer by Yan Li_ Friday, May 27, 2016 6:52 AM
    • Marked as answer by Yan Li_ Wednesday, June 8, 2016 8:46 AM
    Wednesday, May 25, 2016 12:17 PM
  • Hello,

    It seems like that your new management server has some issues so it is not able to run the above powershell code to get the class. Would you please check your event logs for more information?

    Regards,

    Yan Li


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, May 27, 2016 6:56 AM