MS Graph API / Synchronization API - How to set the scope setting?

Viewed 43

In the AzureAD Portal, in "Enterprise applications -> -> Provisioning -> Edit Provisioning -> Settings", I can choose a "scope" between "Sync only assigned users and groups" and "Sync all users and groups".

How can I do that with the Graph API? I couldn't find it anywhere.

Thanks!

1 Answers

I found out by chance how to choose between "Sync only assigned users and groups" and "Sync all users and groups" with GraphAPI.

It's actually part of the ServicePrincipal's synchronization secrets, under the SyncAll key:

GET https://graph.microsoft.com/beta/servicePrincipals/<ID>/synchronization/secrets

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#servicePrincipals('<ID>')/synchronization/secrets",
    "value": [
        {
            "key": "BaseAddress",
            "value": "https://my.server.com/scim"
        },
        {
            "key": "SecretToken",
            "value": "*"
        },
        {
            "key": "SyncNotificationSettings",
            "value": "{\"Enabled\":false,\"DeleteThresholdEnabled\":false,\"HumanResourcesLookaheadQueryEnabled\":false}"
        },
        {
            "key": "SyncAll",
            "value": "false"
        }
    ]
}

I found it in https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/active-directory/app-provisioning/skip-out-of-scope-deletions.md

Related