3
假设我有一个WindowsIdentity
的实例,并且想获得它所属的组。我用下面的代码来获取列表:确定WindowsIdentity实例的嵌套组
WindowsIdentity identity = null;
// get identity here
identity.Groups.Translate(typeof(NTAccount)).Select(x => x.Value);
我得到这样的:
"BUILTIN\\Administrators"
"BUILTIN\\Users"
"NT AUTHORITY\\INTERACTIVE"
"CONSOLE LOGON"
我有了BUILTIN\\Administrators
作为其成员的本地组(比如说,MYSPECIALGROUP
)。上述示例中未返回MYSPECIALGROUP
。我如何获得全部组包括嵌套组?