我正在尝试阅读 AD ACE。问题是,我可以看到权限、继承等,但 ObjectType(ACE 的名称是 GUID 格式)。我正在尝试获取 ObjectType 的友好名称。这是我的代码
System.DirectoryServices.DirectoryEntry userEntry = new DirectoryEntry("LDAP://xx");
System.Security.AccessControl.AuthorizationRuleCollection rules = userEntry.ObjectSecurity.GetAccessRules(true, true, typeof(System.Security.Principal.SecurityIdentifier));
foreach (System.Security.AccessControl.AuthorizationRule rule in rules)
{
System.DirectoryServices.ActiveDirectoryAccessRule oar = rule as System.DirectoryServices.ActiveDirectoryAccessRule;
Console.WriteLine(oar.ObjectType.ToString()); //GUID
....
}
请建议我如何获取对象名称,或者我应该使用不同的 API。
谢谢