4
가능한 중복 :
How to get the groups of a user in Active Directory? (c#, asp.net)현재 Windows 사용자로 로그인 하시겠습니까?
는 현재 System.DirectoryServices.AccountManagement
네임 스페이스를 사용하여 로그온 한 사용자가 얻을 수있는 방법이 있나요?
Dim wi As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
Dim fullName As String = wi.Name.ToString
Dim loggedOnUser = fullName.Substring(fullName.IndexOf("\") + 1)
Console.WriteLine("The currently logged on user is {0}", loggedOnUser)
을하지만 나는 그들이 일반 텍스트에 속하는 그룹 이름과 같은 현재 사용자에 대한 자세한 정보를 원하는, 그리고 AccountManagement
공간이를 제공하는 경우 궁금 해서요 : 나는 다음과 같은 사용했습니다. 당신이 뭔가를 찾고있다
For Each item As IdentityReference In wi.Groups
Console.WriteLine(item.ToString())
Next
에서 구글의 작은 도움으로 그것을 발견? –
어떤 종류의 정보를 원하십니까? GetCurrent()에서 반환 된 WindowsIdentity-object에는 Name보다 많은 정보가 들어 있습니다. http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.aspx – Abbas
죄송합니다. 명시해야합니다. 그들이 속한 그룹 이름을 일반 텍스트로 가져와야하고 그 작업을 수행하는 방법을 알아낼 수 없습니다. – Cuthbert