グループからのメンバの削除
グループの member プロパティからメンバの識別名を削除することによって、グループからメンバを削除できます。識別名を削除するには、削除するメンバの識別名を指定して Remove メソッドを呼び出します。member プロパティの詳細については、MSDN ライブラリ (https://go.microsoft.com/fwlink/?LinkID=27252) の Active Directory スキーマ SDK ドキュメントで、メンバに関する情報を参照してください。
次の例は、グループからメンバを削除する方法を示しています。このタスクは、最初に削除するユーザーを見つけ、次に Remove メソッドを呼び出すと完了します。
// Bind to the group.
DirectoryEntry group = new DirectoryEntry(groupDN);
// Remove the user from the group.
group.Properties["member"].Remove(userDN);
// Commit the changes to the directory.
group.CommitChanges();
関連項目
リファレンス
PropertyValueCollection
System.DirectoryServices
概念
Send comments about this topic to Microsoft.
Copyright © 2007 by Microsoft Corporation. All rights reserved.