proxyAddresses の内容を更新/置換する必要がある ac# スクリプトがあります。次のように値の範囲を追加する方法を理解していると思います。
DirectoryEntry entry = new DirectoryEntry(myConnectString);
DirectorySearcher Dsearch = new DirectorySearcher(entry);
Dsearch.Filter = "(sAMAccountName=" + theUser + ")";
SearchResult result = Dsearch.FindOne();
if (result != null)
{
if (result.Properties.Contains("proxyAddresses"))
{
DirectoryEntry Uentry = result.GetDirectoryEntry();
Uentry.Properties[proxyAddresses].AddRange(new object[] {"user1@domain.com", "user2@domain.com"});
Uentry.CommitChanges();
}
}
ただし、上記のコードのエラーは自由に修正してください。これが正しいように見える場合 - 私の理解では、AddRange は現在の値を置き換えるのではなく、新しい値を追加します。proxyAddresses の既存の内容をこれらの新しい値で削除/置換する方法を説明してもらえますか..? 前もって感謝します。