Start Azure Backsync

Hello,

i have the question if there is the possibility to start the Azure AD Sync via script and not timed/scheduled.

My scenario is to create a user in AD, sync it to AAD and if i know, that the user is successfully synced, a mailbox (remotemailbox) should be created and license assigned.

To be sure that the user is sycned i want use the azure back sync process and track the edsvaO365enabled property which is set by the backsync.

Can you help me out here?

Best regards,
Michael

Parents
  • Hello Michael,

    To answer your first question in general, if there is a way to run workflows in the Sync Service via a script and not have to run them on a schedule. Yes, this can be done via the Sync Service's Management Shell. You can use the below code snippet as reference to accomplish this. For the Back Sync workflow, just replace the text for the $wf_name variable below with the name of the AutoCreated Back Sync workflow. (The path to the Sync Service Mgmt shell is version specific, as you can see by the 7.4 folder reference in the path in the Import-Module line.)

    # Sync Service workflow name
    $wf_name = "Manual Sync"

    # Establish connection to locally installed Sync Service
    Import-Module "C:\Program Files\One Identity\Active Roles\7.4\SyncService\SyncServiceShell\SyncServiceManagementShell.psd1"
    Connect-QCService

    # Execute the workflow
    Start-QCWorkflow -Workflowname $wf_name

Reply
  • Hello Michael,

    To answer your first question in general, if there is a way to run workflows in the Sync Service via a script and not have to run them on a schedule. Yes, this can be done via the Sync Service's Management Shell. You can use the below code snippet as reference to accomplish this. For the Back Sync workflow, just replace the text for the $wf_name variable below with the name of the AutoCreated Back Sync workflow. (The path to the Sync Service Mgmt shell is version specific, as you can see by the 7.4 folder reference in the path in the Import-Module line.)

    # Sync Service workflow name
    $wf_name = "Manual Sync"

    # Establish connection to locally installed Sync Service
    Import-Module "C:\Program Files\One Identity\Active Roles\7.4\SyncService\SyncServiceShell\SyncServiceManagementShell.psd1"
    Connect-QCService

    # Execute the workflow
    Start-QCWorkflow -Workflowname $wf_name

Children