与NT组和Dot.Net合作 [英] Working With NT Groups and Dot.Net
问题描述
我现在不知道如何获取自己想要的信息.
Hi,
I am currently at a loss of how to get the information I am after.
我编写了一个安全类,该安全类可以获取用户所属的所有NT组,但是我的代码不是递归的,所以我不知道如何做到这一点.
I have written a security class that gets all the NT groups a user is a member of, but my code is not recursive, and I cant figure out how to make it so.
当前USER A在GROUP 1中,而GROUP 1在GROUP A中,因此当我获得USER A的有效组列表时
currently USER A is in GROUP 1, but GROUP 1 is in GROUP A, so when I get a list of valid groups for USER A
我希望看到GROUP 1和GROUP A,但是我只会看到GROUP 1.
I would expect to see GROUP 1 and GROUP A, but I only see GROUP 1.
我试图沿用LDAP路线,但不幸的是,我对LDAP并没有很丰富的经验,所以我在这里苦苦挣扎.
我当前的代码看起来像这样
I have tried to go down the LDAP route, but unfortunately I am not very experienced with LDAP so I am struggling there alittle.
my current bit of code looks like this
Dim ADE As New System.DirectoryServices.DirectoryEntry("WinNT://mydomaim/myuser")
Dim ADG As New Object
ADG = ADE.Invoke("groups")
Dim ADM As New Object
_MemberOf.Clear()
For Each grp As Object In ADG
_MemberOf.Add(grp.name)
Me.DataGridView1.Rows.Add(grp.name)
Next
任何帮助都将得到最高评价
注意事项
Dogs_Bollox
any help at all would be most apprieciated
regards
Dogs_Bollox
推荐答案
我相信,要执行此操作,您必须查看tokenGroups属性,该属性比通过memberOf枚举要复杂一些.有关更多信息,请参见以下内容:
http://dunnry.com/blog/EnumeratingTokenGroupsTokenGroupsInNET.aspx
I believe that in order to do this you have to look at the tokenGroups property, which is a bit more complicated than enumerating through memberOf . See the following for more info:
http://dunnry.com/blog/EnumeratingTokenGroupsTokenGroupsInNET.aspx
这篇关于与NT组和Dot.Net合作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!