【发布时间】:2019-12-01 23:01:42
【问题描述】:
我需要在C# 中管理Kerberos Resource Based Delegation(我知道在Powershell 中更容易,但这不是必需的)。 user/computer/service 帐户上的属性是 msDS-AllowedToActOnBehalfOfOtherIdentity,但这似乎是一些 COM 对象,我似乎无法在 C# 中处理:
static void Main(string[] args)
{
string ou = @"OU=some,OU=ou,DC=corp,DC=com";
string cn = @"someaccount";
DirectoryEntry de = new DirectoryEntry();
de.Username = @"CORP\userwithOUrights";
de.Password = @"password";
de.AuthenticationType = AuthenticationTypes.Secure;
de.Path = $"LDAP://CN={cn},{ou}";
Object a = de.Properties["msDS-AllowedToActOnBehalfOfOtherIdentity"];
}
在此之后,a 与其他属性不同,我似乎无能为力。这是一些COM 对象,我需要获取其中的帐户。 Powershell 报告此属性返回一个 System.DirectoryServices.ActiveDirectorySecurity 对象,我在此类中看到有用的方法来解码存储在 AD 等中的二进制格式。但这似乎不是 @987654333 中属性调用的返回类型@。
【问题讨论】:
标签: c# active-directory kerberos-delegation