How to check if a user belongs to an AD group?

后端 未结 3 1408
灰色年华
灰色年华 2020-11-30 23:53

At first I thought the code below works because if I have the group as \"IT\" it functions correctly because my username is in the IT group in active directory. What I learn

3条回答
  •  -上瘾入骨i
    2020-12-01 00:19

    You cannot do it by this way. You should query the active directory. You can use a wrapper for AD. Check out http://www.codeproject.com/Articles/10301/Wrapper-API-for-using-Microsoft-Active-Directory-S

提交回复
热议问题