将现有Windows用户更改为管理员,反之亦然 [英] Change Existing Windows User to Administrator and vice versa

查看:75
本文介绍了将现有Windows用户更改为管理员,反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

作为我项目的一部分,我想使用c#将现有Windows用户更改为管理员,将管理员更改为用户。实际上我想用代码更改权限。

As part of my project I would like to change Existing Windows User to Administrator and Administrator to User using c#. Actually i want to change the privileges using code.

问候

搜寻者

推荐答案

您可以通过更改用户所属的组来完成此操作。成为"管理员"用户只需要在Administrators组中。如果您在AD环境中,请查看

帐户管理
API。

但请注意,您必须是管理员才能成为管理员。另请注意,用户组已缓存,因此用户必须注销并重新登录才能使更改生效。

But note that you have to be an admin to make an admin. Also note that user groups are cached so the user has to log out and back in for the changes to take effect.


这篇关于将现有Windows用户更改为管理员,反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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