使用 Microsoft Graph API 配置多租户组织策略模板

本文介绍如何为多租户组织配置策略模板。

先决条件

跨租户访问策略合作伙伴模板

跨租户访问合作伙伴配置处理合作伙伴租户之间的信任设置和自动用户同意设置。 例如,可以使用这些设置信任来自目标合作伙伴租户的入站用户的多重身份验证声明。 如果模板处于未配置状态,则不会修改多租户组织中的合作伙伴租户的合作伙伴配置,所有信任设置都从默认设置传递。 但是,如果配置模板,则会根据策略模板修改合作伙伴配置。

配置入站和出站自动兑换

若要指定要应用于策略模板的信任设置和自动用户同意设置,请使用 Update multiTenantOrganizationPartnerConfigurationTemplate API。 如果使用 Microsoft 365 管理中心创建或加入多租户组织,则会自动处理此配置。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationPartnerConfiguration

{
    "inboundTrust": {
        "isMfaAccepted": true,
        "isCompliantDeviceAccepted": true,
        "isHybridAzureADJoinedDeviceAccepted": true
    },
    "automaticUserConsentSettings": {
        "inboundAllowed": true,
        "outboundAllowed": true
    },
    "templateApplicationLevel": "newPartners,existingPartners"
}

禁用现有合作伙伴的模板

若要仅将此模板应用于新的多租户组织成员并排除现有合作伙伴,请将 templateApplicationLevel 参数设置为仅新合作伙伴。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationPartnerConfiguration

{
    "inboundTrust": {
        "isMfaAccepted": true,
        "isCompliantDeviceAccepted": true,
        "isHybridAzureADJoinedDeviceAccepted": true
    },
    "automaticUserConsentSettings": {
        "inboundAllowed": true,
        "outboundAllowed": true
    },
    "templateApplicationLevel": "newPartners"
}

完全禁用模板

若要完全禁用模板,请将 templateApplicationLevel 参数设置为 null。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationPartnerConfiguration

{
    "inboundTrust": {
        "isMfaAccepted": true,
        "isCompliantDeviceAccepted": true,
        "isHybridAzureADJoinedDeviceAccepted": true
    },
    "automaticUserConsentSettings": {
        "inboundAllowed": true,
        "outboundAllowed": true
    },
    "templateApplicationLevel": ""
}

重置模板

若要将模板重置为其默认状态(即拒绝所有信任和自动用户同意),请使用 multiTenantOrganizationPartnerConfigurationTemplate: resetToDefaultSettings API。

POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationPartnerConfiguration/resetToDefaultSettings

跨租户同步模板

标识同步策略控制 跨租户同步,允许跨组织中的租户共享用户和组。 可以使用这些设置来允许入站用户同步。 模板处于未配置状态时,不会修改多租户组织中合作伙伴租户的标识同步策略。 但是,如果配置模板,则会修改与策略模板对应的标识同步策略。

配置入站用户同步

若要在策略模板中允许入站用户同步,请使用 Update multiTenantOrganizationIdentitySyncPolicyTemplate API。 如果使用 Microsoft 365 管理中心创建或加入多租户组织,则会自动处理此配置。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationIdentitySynchronization

{
    "userSyncInbound": {
        "isSyncAllowed": true
    },
    "templateApplicationLevel": "newPartners,existingPartners"
}

禁用现有合作伙伴的模板

若要仅将此模板应用于新的多租户组织成员并排除现有合作伙伴,请将 templateApplicationLevel 参数设置为仅新合作伙伴。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationIdentitySynchronization

{
    "userSyncInbound": {
        "isSyncAllowed": true
    },
    "templateApplicationLevel": "newPartners"
}

完全禁用模板

若要完全禁用模板,请将 templateApplicationLevel 参数设置为 null。

请求

PATCH https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationIdentitySynchronization

{
    "userSyncInbound": {
        "isSyncAllowed": true
    },
    "templateApplicationLevel": ""
}

重置模板

若要将模板重置为其默认状态(即拒绝入站同步),请使用 multiTenantOrganizationIdentitySyncPolicyTemplate: resetToDefaultSettings API。

请求

POST https://graph.microsoft.com/beta/policies/crossTenantAccessPolicy/templates/multiTenantOrganizationIdentitySynchronization/resetToDefaultSettings

后续步骤