2009-09-10 4 views

답변

3

그룹 목록을 원하십니까? 또는 사용자가 특정 그룹의 구성원인지 확인하고 싶습니까? 사용자가 특정 그룹에 속하는 경우

후자의 경우에, 당신은 확인 WindowsPrincipal.IsInRole()를 사용할 수 있습니다

예를 들어

http://msdn.microsoft.com/en-us/library/fs485fwh.aspx

, 당신은 사용자가 관리자가 있는지 확인하려면 당신은 사용할 수 있습니다

If Page.User.IsInRole("BUILTIN\Administrators") Then 
    ' Do something 
End If 
2

사용할 수 UserPrincipal.GetAuthorizationGroups Method

imports System.DirectoryServices.AccountManagement 
dim name as string = Request.ServerVariables("LOGON_USER") 
dim user As UserPrincipal = UserPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain), name) 
dim groups As PrincipalSearchResult(Of Principal)= user.GetAuthorizationGroups() 
,536,
관련 문제