c# – 如何使用Microsoft.Azure.ActiveDirectory.GraphClient删除AzureAD中的用户管理器

栏目: 编程工具 · 发布时间: 7年前

内容简介:http://stackoverflow.com/questions/35754241/how-to-remove-a-users-manager-in-azuread-using-microsoft-azure-activedirectory-g
我正在使用 Microsoft.Azure.ActiveDirectory.GraphClient (版本2.1.0)为Azure AD用户管理写一个应用程序.我可以设置一个用户的管理者,但不知道如何清除该字段.

不幸的是, GitHub 提供的示例项目也不包含此功能.

我设法使用下面的代码清除“manager”字段.它没有使用Microsoft.Azure.ActiveDirectory.GraphClient库,但完成了这项工作.
var token = <get your adal token here>
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization = 
    new AuthenticationHeaderValue("Bearer", token);

var url = "https://graph.windows.net/<tenant domain>/users/<userid>/$links/manager?api-version=1.6"
var resp = httpClient.DeleteAsync(url).Result;
if (!resp.IsSuccessStatusCode)
{
    // log / throw exception etc.   
}

http://stackoverflow.com/questions/35754241/how-to-remove-a-users-manager-in-azuread-using-microsoft-azure-activedirectory-g


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Semi-Supervised Learning

Introduction to Semi-Supervised Learning

Xiaojin Zhu、Andrew B. Goldberg / Morgan and Claypool Publishers / 2009-6-29 / USD 40.00

Semi-supervised learning is a learning paradigm concerned with the study of how computers and natural systems such as humans learn in the presence of both labeled and unlabeled data. Traditionally, le......一起来看看 《Introduction to Semi-Supervised Learning》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

html转js在线工具
html转js在线工具

html转js在线工具