Library code snippets
List Windows Groups for authenticated user without Active Directory
- groups.aspx.vb
- groups.aspx
groups.aspx.vb
Imports System.Security.Principal
Partial Public Class groups
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim sb As StringBuilder = New StringBuilder
Dim WinId As IIdentity = User.Identity
Dim userId As WindowsIdentity = DirectCast(WinId, WindowsIdentity)
sb.Append("<b>List of Windows Groups</b> for: " & userId.Name)
Dim irefGroups As IdentityReferenceCollection = userId.Groups.Translate(GetType(NTAccount))
Dim idRef As NTAccount
For i As Integer = 0 To irefGroups.Count - 1
idRef = irefGroups(i)
sb.Append("<br />" & idRef.ToString)
Next
Label1.Text = sb.ToString()
End Sub
End Class
Related articles
- Top 10 Application Security Vulnerabilities in Web.config Files - Part Two
- Top 10 Application Security Vulnerabilities in Web.config Files - Part One
- What You Need to Know about PCI Compliance and Web Application Security Policy Changes
- Effective Controls for Attaining Continuous Application Security Throughout the Web Application Development Life Cycle
Related discussion
-
we search the company in India for program creation under the order
by Yedi (2 replies)
-
How can I execute server-side function using asp.net Ontextchanged orJavascript onchange?
by konikula (6 replies)
-
Send images through Shell(" Net Send") in VB.NET
by Th0mas (2 replies)
-
index out of range
by diwa.net (2 replies)
-
Index out of Range
by kausar4u (4 replies)
Related podcasts
-
Enterprise Architecture
Podcast (MP3): Download Hosts: Markus Guests: Andy Longshaw Recording venue: In this episode Markus and our Guest Andy Longshaw talk about enterprise architecture. More specifically, we talk about some of the patterns in Andy Longshaw's and Paul Dyson's book Archite...
Events coming up
-
Jun
16
Code Generation 2009
Cambridge, United Kingdom
A developer event with a practical focus on helping people get to grips with code generation tools and technologies.
This thread is for discussions of List Windows Groups for authenticated user without Active Directory.