2
我想讀AD的ACE。問題是,我可以看到權限,繼承等,但ObjectType(這是ACE的名稱是GUID格式)。我正在嘗試獲取ObjectType的友好名稱。這裏是我的代碼閱讀活動目錄的ACE
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。
感謝
另一個查詢你能告訴我你是什麼合格作爲「propertyToQuery」和「targetAttribute」? –