WindowsIdentity.Groups Propiedad

Definición

Obtiene los grupos a los que pertenece el usuario de Windows actual.

public:
 property System::Security::Principal::IdentityReferenceCollection ^ Groups { System::Security::Principal::IdentityReferenceCollection ^ get(); };
public System.Security.Principal.IdentityReferenceCollection Groups { get; }
public System.Security.Principal.IdentityReferenceCollection? Groups { get; }
member this.Groups : System.Security.Principal.IdentityReferenceCollection
Public ReadOnly Property Groups As IdentityReferenceCollection

Valor de propiedad

Objeto que representa los grupos a los que pertenece el usuario de Windows actual.

Ejemplos

En el ejemplo de código siguiente se muestra el uso de la Groups propiedad para mostrar las referencias de identidad para los grupos a los que pertenece el usuario actual. Este ejemplo de código es parte de un ejemplo más grande proporcionado para la clase WindowsIdentity.

// Display the SIDs for the groups the current user belongs to.
Console.WriteLine("Display the SIDs for the groups the current user belongs to.");
IdentityReferenceCollection irc = windowsIdentity.Groups;
foreach (IdentityReference ir in irc)
    Console.WriteLine(ir.Value);
' Display the SIDs for the groups the current user belongs to.
Console.WriteLine("Display the SIDs for the groups the current user belongs to.")
Dim irc As IdentityReferenceCollection
Dim ir As IdentityReference
irc = windowsIdentity.Groups
For Each ir In irc
    Console.WriteLine(ir.Value)
Next

Se aplica a