2012-08-02 38 views
0

我有两个功能,其中列出了用户的NT组上的ASP.NET应用程序不同的NT组返回本地/服务器

Private Function getUserGroups() As Boolean 
     ' collect the user domain and identity 
     Dim arr As String() = System.Web.HttpContext.Current.Request.LogonUserIdentity.Name.Split("\"c) 

     Dim al As New ArrayList() 
     al = GetGroups() 

     For Each s As String In al 
      testt.InnerHtml += s & "<br />" 
     Next 

     Return auth 
    End Function 

    Public Function GetGroups() As ArrayList 
     Dim groups As New ArrayList() 
     For Each group As System.Security.Principal.IdentityReference In System.Web.HttpContext.Current.Request.LogonUserIdentity.Groups 
      groups.Add(group.Translate(GetType(System.Security.Principal.NTAccount)).ToString()) 
     Next 
     Return groups 
    End Function 

在本地运行(开发模式),我得到一个更长的名单比我做的时候我在远程服务器上运行:

Local: 

DOMAIN_EX\Domain Users 
Everyone 
BUILTIN\Administrators 
BUILTIN\Users 
NT AUTHORITY\INTERACTIVE 
CONSOLE LOGON 
NT AUTHORITY\Authenticated Users 
NT AUTHORITY\This Organization 
LOCAL 
DOMAIN_EX\Eg12w 
DOMAIN_EX\Eg12 
DOMAIN_EX\SEC_PGP_CommunicationsGroup 
DOMAIN_EX\More 

Remote: 

Everyone 
BUILTIN\Users 
CONSOLE LOGON 
NT AUTHORITY\Authenticated Users 
NT AUTHORITY\This Organization 
LOCAL 

谁能解释的差异,我怎么能解决这个问题,因为我尝试使用组的阵列来验证用户的权限。

回答

0

通过在IIS中禁用匿名身份验证来解决此问题。

相关问题