PrincipalCollection.Remove メソッド

定義

指定したプリンシパル オブジェクトがコレクションのメンバーの場合、指定したプリンシパルをコレクションから削除して、true を返します。それ以外の場合は、false を返します (この場合、操作はなにも実行されません)。

オーバーロード

Remove(ComputerPrincipal)

指定した ComputerPrincipal オブジェクトをコレクションから削除し、ComputerPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

Remove(GroupPrincipal)

指定した GroupPrincipal オブジェクトをコレクションから削除し、GroupPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

Remove(Principal)

指定した Principal オブジェクトをコレクションから削除し、Principal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

Remove(UserPrincipal)

指定した UserPrincipal オブジェクトをコレクションから削除し、UserPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

Remove(PrincipalContext, IdentityType, String)

コレクションで PrincipalContext および identityType/identityValue のペアで指定した UserPrincipal オブジェクトを検索します。特定された Principal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作はなにも実行されません)。

注釈

と同様に AddContains この関数には 4 つのオーバーロードがありますが、これらはすべて同じことを行います。 追加のオーバーロードは、使いやすさを向上させるためにのみ実装されるため、IntelliSense を使用する開発者は、、GroupPrincipal、または ComputerPrincipal オブジェクトを受け取るオーバーロードをUserPrincipal参照できます。 User、Group、または Computer のいずれかのオーバーロードを呼び出すことは、オーバーロードの Principal 呼び出しとまったく同じです。

Remove(ComputerPrincipal)

ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs

指定した ComputerPrincipal オブジェクトをコレクションから削除し、ComputerPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

public:
 bool Remove(System::DirectoryServices::AccountManagement::ComputerPrincipal ^ computer);
public bool Remove (System.DirectoryServices.AccountManagement.ComputerPrincipal computer);
[System.Security.SecurityCritical]
public bool Remove (System.DirectoryServices.AccountManagement.ComputerPrincipal computer);
member this.Remove : System.DirectoryServices.AccountManagement.ComputerPrincipal -> bool
[<System.Security.SecurityCritical>]
member this.Remove : System.DirectoryServices.AccountManagement.ComputerPrincipal -> bool
Public Function Remove (computer As ComputerPrincipal) As Boolean

パラメーター

computer
ComputerPrincipal

ComputerPrincipal オブジェクト。

戻り値

ComputerPrincipal がこの PrincipalCollection のメンバーであった場合は true、それ以外の場合は false

属性

注釈

この関数は、次の例外をスローできます。

例外 説明
InvalidOperationException このメソッドは、ドメイン グループの Members コレクションで呼び出されました。削除されるドメイン プリンシパルは、その primaryGroupId 属性によってグループのメンバーです。

適用対象

Remove(GroupPrincipal)

ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs

指定した GroupPrincipal オブジェクトをコレクションから削除し、GroupPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

public:
 bool Remove(System::DirectoryServices::AccountManagement::GroupPrincipal ^ group);
public bool Remove (System.DirectoryServices.AccountManagement.GroupPrincipal group);
[System.Security.SecurityCritical]
public bool Remove (System.DirectoryServices.AccountManagement.GroupPrincipal group);
member this.Remove : System.DirectoryServices.AccountManagement.GroupPrincipal -> bool
[<System.Security.SecurityCritical>]
member this.Remove : System.DirectoryServices.AccountManagement.GroupPrincipal -> bool
Public Function Remove (group As GroupPrincipal) As Boolean

パラメーター

group
GroupPrincipal

GroupPrincipal オブジェクト。

戻り値

GroupPrincipal がこの PrincipalCollection のメンバーであった場合は true、それ以外の場合は false

属性

注釈

この関数は、次の例外をスローできます。

例外 説明
InvalidOperationException このメソッドは、ドメイン グループの Members コレクションで呼び出されました。削除されるドメイン プリンシパルは、その primaryGroupId 属性によってグループのメンバーです。

適用対象

Remove(Principal)

ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs

指定した Principal オブジェクトをコレクションから削除し、Principal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

public:
 virtual bool Remove(System::DirectoryServices::AccountManagement::Principal ^ principal);
public bool Remove (System.DirectoryServices.AccountManagement.Principal principal);
[System.Security.SecurityCritical]
public bool Remove (System.DirectoryServices.AccountManagement.Principal principal);
abstract member Remove : System.DirectoryServices.AccountManagement.Principal -> bool
override this.Remove : System.DirectoryServices.AccountManagement.Principal -> bool
[<System.Security.SecurityCritical>]
abstract member Remove : System.DirectoryServices.AccountManagement.Principal -> bool
override this.Remove : System.DirectoryServices.AccountManagement.Principal -> bool
Public Function Remove (principal As Principal) As Boolean

パラメーター

principal
Principal

Principal オブジェクト。

戻り値

Principal がこの PrincipalCollection のメンバーであった場合は true、それ以外の場合は false

実装

属性

注釈

この関数は、次の例外をスローできます。

例外 説明
InvalidOperationException このメソッドは、ドメイン グループの Members コレクションで呼び出されました。削除されるドメイン プリンシパルは、その primaryGroupId 属性によってグループのメンバーです。

適用対象

Remove(UserPrincipal)

ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs

指定した UserPrincipal オブジェクトをコレクションから削除し、UserPrincipal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作は何も実行されません)。

public:
 bool Remove(System::DirectoryServices::AccountManagement::UserPrincipal ^ user);
public bool Remove (System.DirectoryServices.AccountManagement.UserPrincipal user);
[System.Security.SecurityCritical]
public bool Remove (System.DirectoryServices.AccountManagement.UserPrincipal user);
member this.Remove : System.DirectoryServices.AccountManagement.UserPrincipal -> bool
[<System.Security.SecurityCritical>]
member this.Remove : System.DirectoryServices.AccountManagement.UserPrincipal -> bool
Public Function Remove (user As UserPrincipal) As Boolean

パラメーター

user
UserPrincipal

UserPrincipal オブジェクト。

戻り値

UserPrincipal がこの PrincipalCollection のメンバーであった場合は true、それ以外の場合は false

属性

注釈

この関数は、次の例外をスローできます。

例外 説明
InvalidOperationException このメソッドは、ドメイン グループの Members コレクションで呼び出されました。削除されるドメイン プリンシパルは、その primaryGroupId 属性によってグループのメンバーです。

適用対象

Remove(PrincipalContext, IdentityType, String)

ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs
ソース:
PrincipalCollection.cs

コレクションで PrincipalContext および identityType/identityValue のペアで指定した UserPrincipal オブジェクトを検索します。特定された Principal がこの PrincipalCollection のメンバーの場合は true を返します。それ以外の場合は false を返します (この場合、操作はなにも実行されません)。

public:
 bool Remove(System::DirectoryServices::AccountManagement::PrincipalContext ^ context, System::DirectoryServices::AccountManagement::IdentityType identityType, System::String ^ identityValue);
public bool Remove (System.DirectoryServices.AccountManagement.PrincipalContext context, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue);
[System.Security.SecurityCritical]
public bool Remove (System.DirectoryServices.AccountManagement.PrincipalContext context, System.DirectoryServices.AccountManagement.IdentityType identityType, string identityValue);
member this.Remove : System.DirectoryServices.AccountManagement.PrincipalContext * System.DirectoryServices.AccountManagement.IdentityType * string -> bool
[<System.Security.SecurityCritical>]
member this.Remove : System.DirectoryServices.AccountManagement.PrincipalContext * System.DirectoryServices.AccountManagement.IdentityType * string -> bool
Public Function Remove (context As PrincipalContext, identityType As IdentityType, identityValue As String) As Boolean

パラメーター

context
PrincipalContext

PrincipalContext オブジェクト。

identityType
IdentityType

identityValue の形式を識別する IdentityType

identityValue
String

文字列。

戻り値

特定した Principal がこの PrincipalCollection のメンバーであった場合は true、それ以外の場合は false

属性

注釈

この関数は、次の例外をスローできます。

例外 説明
InvalidOperationException このメソッドは、ドメイン グループの Members コレクションで呼び出されました。削除されるドメイン プリンシパルは、その primaryGroupId 属性によってグループのメンバーです。
NoMatchingPrincipalException 指定したパラメーターと一致するプリンシパルが見つかりませんでした。
MultipleMatchesException 複数のプリンシパルが、指定したパラメーターと一致します。 理論的には、重複するプリンシパルをコレクションに追加しようとすると例外がスローされるため Add 、これは決して発生しません。 ただし、別の API によって重複が作成された可能性があります。
ArgumentException identityType が空の文字列です。

適用対象