locked
How to start SCSM Connector remotely? RRS feed

  • Question

  • Hi there

    We would like to start SCSM Connectors remotely (we are looking for a powershell script).

    The Problem: sometimes we have to add an AD user and Need then to sync the connector in SCSM to Import all the users from AD again.

    I'v already tried to build something with the commands 'Start-SCSMConnector' but unfortunately it didnt work.

    Does anybody know a solution?

    Thanks and Kind regards

    Wednesday, December 9, 2015 1:17 PM

Answers

  • Hi,

    So long as the analysts' PCs have the Service Manager console installed you can run the command on the PC rather than trying to invoke it remotely.

    Firstly on the server get the actual name of the connector (rather than the display name) as it's quicker than searching all the connectors:

    New-SCManagementGroupConnection
    Get-SCSMConnector | ft Name,DisplayName
    

    This should give output similar to this:

    Name                                                        DisplayName
    ----                                                        -----------
    ADConnector.8244b690ad324cb5b96f980e8fd3396a                Full Test Domain
    

    Then on the analysts' PCs you just need to run code similar to the following:

    New-SCManagementGroupConnection -ComputerName smserver.mydomain.local
    Start-SCSMConnector -Connector ( Get-SCSMConnector -Name ADConnector.8244b690ad324cb5b96f980e8fd3396a )

    Obviously you replace "smserver.mydomain.local" with a management server name and "ADConnector.8244b690ad324cb5b96f980e8fd3396a" with the unique name displayed on the server earlier. The connector should then start - well, when SCSM is good and ready.

    Depending on your PowerShell configuration you may need to import the SCSM PowerShell modules if you're calling this from a script. Also the analyst would need rights to be able to start the connector. I'm not sure about the rights but I would expect you'd need to be at least an advanced operator (I haven't got access to SCSM to check at the minute). Perhaps some other helpful poster could confirm.

    Thursday, December 10, 2015 4:26 PM

All replies

  • Hello,

    What is the result when you run the command? You should make sure the connector is enabled, as you cannot initiate synchronization for a connector that is currently disabled.

    If you use get-scsmconnector | start-SCSMorchestrator command it will restart all your connectors,  you can specify which one you want to load.

    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, December 10, 2015 6:12 AM
  • Hi Yan Li

    Many thanks for your fast reply!

    I'm one step further. I can sync one of the connectors with the following commands on the SCSM Server without any issue (The Name of the connector is "Import AD Users"):

     

    $SCSMConnector = get-scsmconnector | Where-Object {$_.DisplayName -eq "Import AD Users"} Start-SCSMConnector $SCSMConnector


    But if I want to start that command remotely (on one of the analysts PCs), I dont know how to do that.

    I've tried the following commands ([servername] is replaced by the Name of our Server):

    Invoke-Command -ComputerName [servername] -ScriptBlock {$SCSMConnector = get-scsmconnector | Where-Object {$_.DisplayName -eq "Import AD Users"}} 
    Invoke-Command -ComputerName [servername] -ScriptBlock {Start-SCSMConnector $SCSMConnector} 


    and

    $connector = Invoke-Command -ComputerName [servername] -ScriptBlock {$SCSMConnector = get-scsmconnector | Where-Object {$_.DisplayName -eq "Import AD Users"}} 
    Invoke-Command -ComputerName [servername] -ScriptBlock {Start-SCSMConnector $connector} 

    In both cases the following error prompt is being displayed


    Do you have a clue what I am doing wrong?

    Thanks and Kind regards

    Silas


    • Edited by Silas Sulser Thursday, December 10, 2015 4:15 PM
    Thursday, December 10, 2015 11:50 AM
  • Hi,

    So long as the analysts' PCs have the Service Manager console installed you can run the command on the PC rather than trying to invoke it remotely.

    Firstly on the server get the actual name of the connector (rather than the display name) as it's quicker than searching all the connectors:

    New-SCManagementGroupConnection
    Get-SCSMConnector | ft Name,DisplayName
    

    This should give output similar to this:

    Name                                                        DisplayName
    ----                                                        -----------
    ADConnector.8244b690ad324cb5b96f980e8fd3396a                Full Test Domain
    

    Then on the analysts' PCs you just need to run code similar to the following:

    New-SCManagementGroupConnection -ComputerName smserver.mydomain.local
    Start-SCSMConnector -Connector ( Get-SCSMConnector -Name ADConnector.8244b690ad324cb5b96f980e8fd3396a )

    Obviously you replace "smserver.mydomain.local" with a management server name and "ADConnector.8244b690ad324cb5b96f980e8fd3396a" with the unique name displayed on the server earlier. The connector should then start - well, when SCSM is good and ready.

    Depending on your PowerShell configuration you may need to import the SCSM PowerShell modules if you're calling this from a script. Also the analyst would need rights to be able to start the connector. I'm not sure about the rights but I would expect you'd need to be at least an advanced operator (I haven't got access to SCSM to check at the minute). Perhaps some other helpful poster could confirm.

    Thursday, December 10, 2015 4:26 PM
  • Hi Andreas

    Many thanks for your fast help!

    It worked like a charm :)!

    I'm so happy with your solution!

    Have a nice weekend

    Kind regards

    Silas

    Friday, December 11, 2015 3:18 PM
  • When it says "Proposed as answer"...

    Still, round these here parts I guess being confused with Andreas is pretty cool.

    Saturday, December 19, 2015 12:30 PM