How to check if a given user is a member of the built-in Administrators group?

后端 未结 4 1667
刺人心
刺人心 2021-01-15 03:28

I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the ap

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 03:38

    There is a Win32 API for this you could P/Invoke: IsUserAnAdmin

    The question is more complex on Vista ... see this blog post.

提交回复
热议问题