C#Graph API启用/禁用用户帐户 [英] C# Graph API enable/disable user accounts

查看:85
本文介绍了C#Graph API启用/禁用用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试创建一个控制台应用程序,该应用程序可以使用图表API启用/禁用用户帐户,使用密钥/密钥作为凭据。

We are trying to create a console app that can enable/disable user accounts using the graph API utilizing a key/secret for the credentials.

我们可以读取数据但是我们无法进行更改。首先,这可以使用API​​吗?如果是这样,您如何/在何处为API密钥提供执行此操作所需的权限?

We can read data but we are unable to make changes. First, is this possible to do using the API? If so, how/where do you go to give the API key the permissions needed to do so?

尝试更改enableAccount属性。

Trying to change the enableAccount property.

使用powershell命令是否有更好的选择,某种服务帐户有权访问?

Would using powershell commands be a better option with some kind of service account that has access to do so?

推荐答案

对于MS Graph,有图表浏览器
here
。您可以使用它来使用API​​。至于功能(不断变化)你可以找到用户的东西

在这里
。目前,您似乎无法停用帐户。你可以创建/删除用户,因为它可能还没有记录。

For MS Graph there is a graph explorer available here. You can use this to play around with the API. As for the functionality (which is ever changing) you can find User stuff here. At this time it doesn't appear you can disable an account. You can create/delete users so it may be there just not documented yet.

PS和C#我认为这取决于你。如果你想要一个快速的脚本能够运行,那么使用PS。如果您正在构建一个需要其他功能的大型应用程序,那么简单的C#应用​​程序可能会更容易。如果您只是构建一个C#控制台应用程序来调整
用户帐户,那么PS更简单。

As for PS vs C# I think it is up to you. If you want a quick script to be able to run then use PS. If you're building a larger app that needs other functionality then a simple C# app might be easier. If you are just building a C# console app to adjust a user account though then PS is simpler.


这篇关于C#Graph API启用/禁用用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆