2

管理する必要があります(管理Kerberos Resource Based DelegationするC#方が簡単なのはわかってい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 などに格納されているバイナリ形式をデコードするための便利なメソッドがあります。しかし、これは のプロパティ呼び出しからの戻り値の型ではないようですC#

4

1 に答える 1