如何使用Azure AD Graph API for Microsoft Graph API更新现有的用户SignInName?

问题描述 投票:1回答:2

如何使用Microsoft Graph或Azure AD Graph Client更新Azure AD中现有用户的SignInName。

谢谢!

azure azure-active-directory microsoft-graph azure-ad-graph-api
2个回答
3
投票

看起来无法通过Microsoft Graph API或Azure Graph API更新SignInName。如果适合您的使用案例,可能值得尝试使用PowerShell(这可能会也可能不会起作用)。关于下面每个的详细信息..

  1. 使用Microsoft Graph API更新用户SignInName 这是不可能的,因为SignInNames集合甚至不能作为Microsoft Graph中用户实体的一部分使用。 这是关于这个主题的GitHub问题线程,看看最后。 Add signInNames property to User. #91

enter image description here

  1. 使用Azure AD Graph API更新用户SignInName

您只能在创建用户时设置User SignInNames集合。请参阅文档仅提及POST和GET(无PATCH)

https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/entity-and-complex-type-reference#user-entity

enter image description here

enter image description here

  1. 使用PowerShell更新用户SignInName 这可能会有用,但我不确定。然后,您再次专门询问Microsoft Graph或Azure AD Graph API,因此您的方案可能不适合PowerShell。 Set-AzureADUser

enter image description here


0
投票

您可以使用Azure AD Graph API(signInNames)作为更新来修补graph.windows.net

PATCH https://graph.windows.net/{tenantId}/users/{userId}?api-version=1.6
Content-Type: application/json

BODY:
{
    "givenName": "James Wood",
    "signInNames": [
        {
            "type": "userName",
            "value": "jamesWoodUserName"
        }
    ]
}
© www.soinside.com 2019 - 2024. All rights reserved.