开发者

finding out if user used for DirectoryEntry connection is an administrator

开发者 https://www.devze.com 2023-01-06 11:57 出处:网络
I have an existing DirectoryEntry connection and I want to check if the user that was used for the creation of this DirectoryEntry belongs t开发者_Go百科o a specific group.

I have an existing DirectoryEntry connection and I want to check if the user that was used for the creation of this DirectoryEntry belongs t开发者_Go百科o a specific group. anyone knows how to achieve this?

Thanks, Shuky


I don't think there's any magic, easy way to do this....

On the DirectoryEntry object, you do have a UserName property which should hold the name of the user that was used to create this entry, if a specific user was supplied. Using that user name, you could do a directory lookup and find that user and check whether that user belongs to the Administrators group (or any other group) - but it's not exactly a one-liner.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号