WindowsIdentity.Groups Eigenschap

Definitie

Hiermee haalt u de groepen op waartoe de huidige Windows gebruiker behoort.

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

Waarde van eigenschap

Een object dat de groepen vertegenwoordigt waartoe de huidige Windows gebruiker behoort.

Voorbeelden

In het volgende codevoorbeeld ziet u het gebruik van de Groups eigenschap om de identiteitsverwijzingen weer te geven voor de groepen waartoe de huidige gebruiker behoort. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de WindowsIdentity klasse.

// 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

Van toepassing op