DirectoryEntry toFix = new DirectoryEntry(groupPath, privilegedUserName, privilegedPassword, AuthenticationTypes.Secure);
toFix.Properties["proxyAddresses"] の既存のリストに "SMTP:bleh@myemail.com" を追加する方法はありますか?
DirectoryEntry toFix = new DirectoryEntry(groupPath, privilegedUserName, privilegedPassword, AuthenticationTypes.Secure);
toFix.Properties["proxyAddresses"] の既存のリストに "SMTP:bleh@myemail.com" を追加する方法はありますか?
この MSDN トピックを確認してください: Setting Properties with Multiple Values。上記のリンクからいくつかのコード サンプルを示します。
次のコード例は、AddRange メソッドの使用方法を示しています。
DirectoryEntry ent = new DirectoryEntry("LDAP://Fabrikam/CN=My Username,CN=Users,DC=Fabrikam,DC=com");
ent.Properties["otherTelephone"].AddRange(new object[] {"(425) 523 1462","(523) 125 6321"});
ent.CommitChanges();
次のコード例は、Insert メソッドの使用方法を示しています。
DirectoryEntry ent = new DirectoryEntry("LDAP://Fabrikam/CN=My Username,CN=Users,DC=Fabrikam,DC=com");
ent.Properties["otherTelephone"].Insert(2, "525 623 5423");
ent.CommitChanges();
次のコード例は、配列を使用して複数値プロパティに値を設定する方法を示しています。
DirectoryEntry ent = new DirectoryEntry("LDAP://Fabrikam/CN=My Username,CN=Users,DC=Fabrikam,DC=com");
ent.Properties["otherTelephone"][0] = "425 263 6234";
ent.CommitChanges();