PrincipalCollection.Remove Método

Definição

Remove a entidade de segurança especificada da coleção e retorna true se o objeto de entidade de segurança especificado for um membro da coleção; caso contrário, retorna false (neste caso, nenhuma operação é executada).

Sobrecargas

Remove(ComputerPrincipal)

Remove o objeto ComputerPrincipal especificado da coleção e retorna true se o ComputerPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

Remove(GroupPrincipal)

Remove o objeto GroupPrincipal especificado da coleção e retorna true se o GroupPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

Remove(Principal)

Remove o objeto Principal especificado da coleção e retorna true se o Principal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

Remove(UserPrincipal)

Remove o objeto UserPrincipal especificado da coleção e retorna true se o UserPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

Remove(PrincipalContext, IdentityType, String)

Encontra o objeto UserPrincipal especificado pelo par PrincipalContext e identityType/identityValue da coleção e retorna true se o Principal identificado era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

Comentários

Assim como acontece com Add, e Contains há quatro sobrecargas para essa função, mas todas elas fazem a mesma coisa. As sobrecargas extras são implementadas apenas para melhorar a usabilidade, para que os desenvolvedores que usam o IntelliSense vejam sobrecargas que usam um UserPrincipalobjeto , GroupPrincipalou ComputerPrincipal . Chamar qualquer uma das sobrecargas de Usuário, Grupo ou Computador é exatamente equivalente a chamar a Principal sobrecarga.

Remove(ComputerPrincipal)

Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs

Remove o objeto ComputerPrincipal especificado da coleção e retorna true se o ComputerPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

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

Parâmetros

computer
ComputerPrincipal

Um objeto ComputerPrincipal.

Retornos

true se o ComputerPrincipal era membro dessa PrincipalCollection; caso contrário, false.

Atributos

Comentários

Essa função pode gerar as seguintes exceções:

Exceção Descrição
InvalidOperationException Esse método foi chamado na Members coleção para um grupo de domínio e a entidade de segurança de domínio a ser removida é um membro do grupo em virtude de seu primaryGroupId atributo.

Aplica-se a

Remove(GroupPrincipal)

Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs

Remove o objeto GroupPrincipal especificado da coleção e retorna true se o GroupPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

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

Parâmetros

group
GroupPrincipal

Um objeto GroupPrincipal.

Retornos

true se o GroupPrincipal era membro dessa PrincipalCollection; caso contrário, false.

Atributos

Comentários

Essa função pode gerar as seguintes exceções:

Exceção Descrição
InvalidOperationException Esse método foi chamado na Members coleção para um grupo de domínio e a entidade de segurança de domínio a ser removida é um membro do grupo em virtude de seu primaryGroupId atributo.

Aplica-se a

Remove(Principal)

Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs

Remove o objeto Principal especificado da coleção e retorna true se o Principal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

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

Parâmetros

principal
Principal

Um objeto Principal.

Retornos

true se o Principal era membro dessa PrincipalCollection; caso contrário, false.

Implementações

Atributos

Comentários

Essa função pode gerar as seguintes exceções:

Exceção Descrição
InvalidOperationException Esse método foi chamado na Members coleção para um grupo de domínio e a entidade de segurança de domínio a ser removida é um membro do grupo em virtude de seu primaryGroupId atributo.

Aplica-se a

Remove(UserPrincipal)

Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs

Remove o objeto UserPrincipal especificado da coleção e retorna true se o UserPrincipal era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

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

Parâmetros

user
UserPrincipal

Um objeto UserPrincipal.

Retornos

true se o UserPrincipal era membro dessa PrincipalCollection; caso contrário, false.

Atributos

Comentários

Essa função pode gerar as seguintes exceções:

Exceção Descrição
InvalidOperationException Esse método foi chamado na Members coleção para um grupo de domínio e a entidade de segurança de domínio a ser removida é um membro do grupo em virtude de seu primaryGroupId atributo.

Aplica-se a

Remove(PrincipalContext, IdentityType, String)

Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs
Origem:
PrincipalCollection.cs

Encontra o objeto UserPrincipal especificado pelo par PrincipalContext e identityType/identityValue da coleção e retorna true se o Principal identificado era membro deste PrincipalCollection; caso contrário, retorna false (neste caso, o método não realiza nenhuma operação).

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

Parâmetros

context
PrincipalContext

Um objeto PrincipalContext.

identityType
IdentityType

Uma IdentityType que identifica o formato de identityValue.

identityValue
String

Uma cadeia de caracteres.

Retornos

true se o Principal identificado era membro dessa PrincipalCollection. Caso contrário, false.

Atributos

Comentários

Essa função pode gerar as seguintes exceções:

Exceção Descrição
InvalidOperationException Esse método foi chamado na Members coleção para um grupo de domínio e a entidade de segurança de domínio a ser removida é um membro do grupo em virtude de seu primaryGroupId atributo.
NoMatchingPrincipalException Nenhuma entidade de segurança que corresponda aos parâmetros especificados foi encontrada.
MultipleMatchesException Mais de uma entidade de segurança corresponde aos parâmetros especificados. Em teoria, isso nunca deve acontecer, pois Add gera uma exceção quando há uma tentativa de adicionar entidades de segurança duplicadas à coleção. No entanto, é possível que outra API tenha criado a duplicata.
ArgumentException identityType é uma cadeia de caracteres vazia.

Aplica-se a