简体   繁体   English

如何使用 Microsoft Graph 更新云用户的扩展属性 API

[英]How do I update the extensionAttributes for a cloud user using Microsoft Graph API

Microsoft's documentation states微软的文档说明

For an onPremisesSyncEnabled user, the source of authority for this set of properties is the on-premises and is read-only.对于 onPremisesSyncEnabled 用户,这组属性的权限来源是本地,并且是只读的。 For a cloud-only user (where onPremisesSyncEnabled is false), these properties may be set during creation or update.对于纯云用户(其中 onPremisesSyncEnabled 为 false),可以在创建或更新期间设置这些属性。 These extension attributes are also known as Exchange custom attributes 1-15.这些扩展属性也称为 Exchange 自定义属性 1-15。

I have confirmed that this user is not sync nor has ever been synced我已确认此用户未同步,也从未同步过

{
    "onPremisesDistinguishedName": null,
    "onPremisesDomainName": null,
    "onPremisesImmutableId": null,
    "onPremisesLastSyncDateTime": null,
    "onPremisesSecurityIdentifier": null,
    "onPremisesSamAccountName": null,
    "onPremisesSyncEnabled": null,
    "onPremisesUserPrincipalName": null,
}

Here is my request这是我的要求

Server: graph.microsoft.com
Path: /beta/users/<user id removed>
Method: PATCH

Body:
{
    "onPremisesExtensionAttributes": {
        "extensionAttribute14": "8500005",
        "extensionAttribute15": "008500005"
    }
}

Response回复

{
    "error": {
        "code": "Request_BadRequest",
        "message": "Unable to update the specified properties for objects that have originated within an external service.",
        "innerError": {
            "date": "...",
            "request-id": "...",
            "client-request-id": "..."
        }
    }
}

Recently we faced this issue with a client.最近我们遇到了一个客户这个问题。 where old accounts were throwing this error "Unable to update the specified properties for objects that have originated within an external service" when we are trying to use Graph API or Power Automate.当我们尝试使用 Graph API 或 Power Automate 时,旧帐户抛出此错误“无法更新源自外部服务的对象的指定属性”。

We confirmed with client if they were earlier synced on-premises but IT team had no information of past.我们与客户确认他们是否早些时候在本地同步,但 IT 团队没有过去的信息。 So we run the command Set-MsolDirSyncEnabled -EnableDirSync $false所以我们运行命令 Set-MsolDirSyncEnabled -EnableDirSync $false

After running this command all extension attributes 1-15 were moved to Exchange online.运行此命令后,所有扩展属性 1-15 都被移动到 Exchange online。 We raised Microsoft Support ticket to change the source back to Azure AD.我们提出了 Microsoft 支持票,将源更改回 Azure AD。 But after 1 month of long discussion we were told that "It's NOT Possible to revert back".但经过 1 个月的长时间讨论后,我们被告知“不可能恢复原状”。

We have to create Azure runbook to update these extension attributes using PowerShell我们必须创建 Azure 运行手册以使用 PowerShell 更新这些扩展属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Graph API 无法写入 ExtensionAttributes - Microsoft Graph API cannot write to ExtensionAttributes 如何在 Microsoft graph Api 中更新登录用户 - How to Update signin User in Microsoft graph Api 通过UPN更新多个用户ExtensionAttributes - Update Multiple User ExtensionAttributes by UPN 使用Microsoft Graph API进行本地用户配置文件更新 - On-Premises User Profile Update Using Microsoft Graph API 如何使用控制台应用程序通过 Microsoft Graph API 调用 Microsoft Teams OnlineMeeting 端点? - How do I Call Microsoft Teams OnlineMeeting endpoints via Microsoft Graph API using a console app? Microsoft Azure AD 图 API:如何检索用户的 email 地址? - Microsoft Azure AD graph API: How do I retrieve a user's email address? 如何使用 Microsoft Graph API 和 java 为用户获取日历事件 - How to fetch calendar events for a user using Microsoft Graph API with java 如何使用 Microsoft Graph API 获取所有组的用户名? - How to get user names of all groups using Microsoft Graph API? 如何获取用户的组名是使用 Microsoft Graph API 的成员? - How to get group names of the user is a member of using Microsoft Graph API? 使用 Microsoft Graph 如何获取从本地 AD 同步的 Azure AD 用户字段 - Using Microsoft Graph how do i get Azure AD user fields that were synced from On Premise AD
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM