Share via


WindowsIdentity.Groups 속성

정의

현재 Windows 사용자가 속해 있는 그룹을 가져옵니다.

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

속성 값

현재 Windows 사용자가 속해 있는 그룹을 나타내는 개체입니다.

예제

다음 코드 예제에서는 사용 Groups 된 현재 사용자가 속한 그룹에 대 한 ID 참조를 표시 하는 속성입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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

적용 대상