【发布时间】:2016-10-19 17:14:07
【问题描述】:
在 Azure AD 中将成员添加到组时出现问题,收到此错误消息:
无法更新本地主控的指定属性 目录同步对象或当前正在迁移的对象
我正在尝试将 azure AD 的现有成员添加到现有组,但我收到“错误请求”的响应。对于某些调用 updateasync 工作正常,但成员未添加到组中。我已经提供了我正在尝试解决以下错误的代码。请建议是否有人遇到过同样的问题并解决它。谢谢。
代码:-
IUser newUser = await GetUser(userKey);
Microsoft.Azure.ActiveDirectory.GraphClient.Group retrievedGroup = new Microsoft.Azure.ActiveDirectory.GraphClient.Group();
List<IGroup> foundGroups = null;
foundGroups = adClient.Groups
.Where(group => group.DisplayName.StartsWith(groupName))
.ExecuteAsync().Result.CurrentPage.ToList();
if (foundGroups != null && foundGroups.Count > 0)
{
retrievedGroup = foundGroups.First() as Microsoft.Azure.ActiveDirectory.GraphClient.Group;
}
if (retrievedGroup.ObjectId != null)
{
retrievedGroup.Members.Add(newUser as DirectoryObject);
await retrievedGroup.UpdateAsync();
}
错误:-
{"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Unable to update the specified properties for on-premises mastered Directory Sync objects or objects currently undergoing migration."},"date":"2016-10-18T08:02:22","requestId":"c757689c-6135-4198-9e4d-6a7aaa1135e7","values":null}}
【问题讨论】:
标签: asp.net asp.net-web-api azure-ad-graph-api