M
Mark
Hello Friends
Please check following Code
Dim x As System.Security.Principal.WindowsPrincipal
x = System.Threading.Thread.CurrentPrincipal
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Authe
nticationType & "<BR>")
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Name
& "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.Administrator
) & "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.User)
& "<BR>")
Response.Write(x.IsInRole("MyDomain\MyGroup")
& "<BR>")
Response.Write("<BR>----<BR>")
x = New System.Security.Principal.WindowsPrincipal
(System.Security.Principal.WindowsIdentity.GetCurrent)
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Authe
nticationType & "<BR>")
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Name
& "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.Administrator
) & "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.User)
& "<BR>")
Response.Write(x.IsInRole("MyDomain\MyGroup")
& "<BR>")
The result using Basic Windows Authentication, and looged
in with a valid user name "validusername".
NTLM
FUSION-PUNE\validusername
True
True
False
----
NTLM
FUSION-PUNE\validusername
True
True
False
The result when "Anonymous Access" set in IIS.
NTLM
FTPUNE0025\IUSR_FTPUNE0025
False
False**********
False
----
NTLM
FTPUNE0025\IUSR_FTPUNE0025
False
True****
False
**** Why there is a difference for same user.
Regards
Mark
Please check following Code
Dim x As System.Security.Principal.WindowsPrincipal
x = System.Threading.Thread.CurrentPrincipal
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Authe
nticationType & "<BR>")
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Name
& "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.Administrator
) & "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.User)
& "<BR>")
Response.Write(x.IsInRole("MyDomain\MyGroup")
& "<BR>")
Response.Write("<BR>----<BR>")
x = New System.Security.Principal.WindowsPrincipal
(System.Security.Principal.WindowsIdentity.GetCurrent)
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Authe
nticationType & "<BR>")
Response.Write
(System.Security.Principal.WindowsIdentity.GetCurrent.Name
& "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.Administrator
) & "<BR>")
Response.Write(x.IsInRole
(System.Security.Principal.WindowsBuiltInRole.User)
& "<BR>")
Response.Write(x.IsInRole("MyDomain\MyGroup")
& "<BR>")
The result using Basic Windows Authentication, and looged
in with a valid user name "validusername".
NTLM
FUSION-PUNE\validusername
True
True
False
----
NTLM
FUSION-PUNE\validusername
True
True
False
The result when "Anonymous Access" set in IIS.
NTLM
FTPUNE0025\IUSR_FTPUNE0025
False
False**********
False
----
NTLM
FTPUNE0025\IUSR_FTPUNE0025
False
True****
False
**** Why there is a difference for same user.
Regards
Mark