Reading active directory user id for a user group

I need to write a function that accepts active directory user group and return all the users belong to that group. My function so far returns user fist name, last name and so on except userid. I am not sure how to retreive that.

 Dim path As String = "LDAP://asd.dev.com"
        Dim entry As DirectoryEntry = New DirectoryEntry(path)
        Try
            'Dim native As Object = entry.NativeObject

            Dim search As DirectorySearcher = New DirectorySearcher(entry)
            search.Filter = String.Format("(cn={0})", "MD_GROUP") 'User group
            search.PropertiesToLoad.Add("member")

            Dim result As SearchResult = search.FindOne()
            If result Is Nothing Then
                Response.Write("error")
            Else

                For Each key As String In result.Properties.PropertyNames
                    For Each propValue As Object In result.Properties(key)
                        Response.Write(key & " = " & propValue & "<br>")
                    Next
                Next
            End If

 Please help. Any help is greatly appriciated.

0
coolvaas1
1/26/2007 9:54:25 PM
asp.net.active-directory-ldap 2291 articles. 0 followers. Follow

0 Replies
798 Views

Similar Articles

[PageSpeed] 38

Reply:

Similar Artilces:

Return All Users with User Groups from Active Directory with LDAP
Hello.  I am trying to write a report that pulls information in from Active Directory.  I have a view created that gets a listing of users and a view that creates a listing of user groups, but I can't seem to figure out how to get all user groups that are associated with the users.  This is what I have. SELECT     *FROM         OPENQUERY(ADSI, 'SELECT objectSid, samAccountName, distinguishedName FROM ''LDAP://wmdomain.local''WHERE objectClass = ''User''')    ...

Reading active directory user id
I have a requirement to retreive all the active directory users when a specific user group isentered. And I have the following code that does that. But my problem is it retreives everything but the user id.How do I get only the user id? Please help.     Public Function GetADGroupUsers(ByVal groupName As String) As ArrayList         Dim result As SearchResult         Dim search As DirectorySearcher = New DirectorySearcher()        search.Filter = String.Format("(cn={0})",...

Is there a way to authenticate Active Directory users from multiple Active Directory Domains
Is there a way to authenticate Active Directory users from multiple Active Directory Domains in ASP.NET Application using C# or VB.NET?Suppose I have a LoginId "user1" from one of the three Active Directory Domains how can I authenticate it?I have two Active Directory domains. I can authenticate from the Active Directory Domain where my current system Account is logged in. But I can not authenticate from other Active Directory Domains. Actually I have 2 Active Directory domains in my LAN.Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.ww...

How to check the username with active directory and fetch the user details from the active directory?
I have a textbox with a submit button.When the admin types the username in the textbox and submits it has to check with active directory and fetch the firstname and last name of the user entered inthe textbox.How will i do this one.Code is appreciated. you will find lot of samples if you search for "ActiveDirectory using .NET" but here is a verysimple code and it works too:-) strLANID = "ADDomainName\user"           Dim dservices As New System.DirectoryServices.DirectoryEntry        ...

Net::LDAP, Active Directory and Disabled Users
------_=_NextPart_001_01C386CB.502F3B30 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I've been trying to write a simple perl script that will query the = active directory via LDAP and give me a list of email addresses for disabled = users (eg, addresses we don't want to accept email for anymore). I found a = website or two that suggested I use the following as my filter: (&(objectCategory=3Dperson)(userAccountControl:1.2.840.113556.1.4.803:=3D= 2)) I was beginning to think these websites were wrong as whene...

Net::LDAP, Active Directory and Disabled Users #2
I've been trying to write a simple perl script that will query the active directory via LDAP and give me a list of email addresses for disabled users (eg, addresses we don't want to accept email for anymore). I found a website or two that suggested I use the following as my filter: (&(objectCategory=person)(userAccountControl:1.2.840.113556.1.4.803:=2)) I was begining to think these websites were wrong as whenever I tried this filter, I'd go no results. With other filters, I'd get the results I'd expect to get. I then tried that filter in a couple other appli...

RE: Net::LDAP, Active Directory and Disabled Users
Version of Perl:=20 5.8.0 (as supplied with RedHat9) Version of Net::LDAP: [jsteenha@jake utilities]$ perl -mNet::LDAP -e 'print = "$Net::LDAP::VERSION\n"' 0.29 Relevant part of Perl code: #!/usr/bin/perl use Net::LDAP; use Net::LDAP::Filter; $filter =3D = '(&(objectCategory=3Dperson)(userAccountControl:1.2.840.113556.1.4.803:=3D= 2))'; #$filter =3D '(objectCategory=3Dperson)'; $f =3D new Net::LDAP::Filter; $f->parse($filter); $f->print(); #exit; my $ldap =3D Net::LDAP->new('acutex-dc01'); my $mesg =3D $...

Active Directory user home directory
Hi all. I have a question, how to sync home directorires of users from Identity Vault to Active Directory? Into AD there are 2 LDAP attributes calleds homeDrive (the network drive letter) and homeDirectory that is the network path used to map during user login. My doubt is about the eDirectory volume information. The volume will be not sync to the AD because AD does not recognize this information, right? So, how to sync? I was thinking about create 2 eDirectory attributes where I can write theese informations. What do you think about this? Anyone can help me? Best regards...

Active directory groups are not listed for a user (at times ) using LDAP
Hi All, I am using LDAP to get active directroy groups for a given user.  I am able to see the AD gorups list some times. But it is not consistent.  Some times I get empty list. If any one can help in this regard, It would be great. If you have any other way of getting AD groups Please let me know.  This is the code I am using Public Shared Function GetADUserGroups(ByVal UserName As String) As String Dim grouplist As New StringBuilder() Dim result As SearchResult Dim groupcount As Integer = 0 Dim counter As Integer = 0 Dim pos As Integer Dim search As New Dire...

active directory user group
Hi I need to get a list of members of an active directory user group (eg:sales) in my asp.NET web form. Could someone please hepl? thanks This would probably help; courtesy Erick Sgarbi from Windows.NET [1] <% @Import Namespace="System.DirectoryServices" %> <% DirectoryEntry de = new DirectoryEntry("LDAP://CN=Users,DC=VBOX,DC=DEV,DC=AU" ,"administrator","client"); foreach(DirectoryEntry child in de.Children) { Response.Write("<BR>" + child.Name.ToString()); } %> [1] Viewing Active Dir...

Active directory users group
hi i have an application where in i check the active directory group of an active directory user. how can i get the user group? i think this link will serve the purpose for u http://codepal.co.in/bb/viewtopic.php?t=431CheersBinowww.codepal.co.inPlease Mark as Answer if you find the post useful. Hi johnedep,   Please go through the link below: http://support.microsoft.com/kb/326340 (link for VB code) http://support.microsoft.com/kb/316748 (link for C# code) This site contains all the details you require. look for GetGroups method, it return the string containing all...

Active Directory- Users and Groups
Hi All, I have a requirement to pull the information from the Active Directory based on the Users and Groups. I would be greatful if you could provide some sample code on the following two:- 1. Based on the user input(Login ID) how to pull the information from the AD 2. Based on the user input(Group Name) how to pull groups from the AD  Many Thanks, Madhu        Friend, this will help on using the Active Directory features to begin with http://www.15seconds.com/issue/060525.htm http://www.wwwcoder.com/main/parentid/272/site/5...

Membership Users not matching Active Directory users
I'm having trouble w/ my intranet security using window authentication. When I get the User.Identity.Name it returns Domain\UserName. However, I'm using AspNetSqlRoleProvider and when I assign roles using the asp net website administration tool, my users appear as UserName@Domain.com. Then when I add users to roles and apply security to folders, users can still access those folders. Is this because the UserNames are not matching? My Roles and Membership appear to talking, but passing the wrong username? Also if i try and find myself in "Administors" user.isinrole, i am not in any role. I'm ...

Active Directory
Could somebody please point me in the right direction?  I'm attempting to make a website pulling information from active directory.  I am able to pull specific user information using VBS but am very lost as to how to port this type of stuff over to a website.  Could somebody please post some examples or websites showing how to display maybe just all users from AD? Thanks so much. ...

Web resources about - Reading active directory user id for a user group - asp.net.active-directory-ldap

Wikipedia:Quick directory - Wikipedia, the free encyclopedia
This page is a handy directory to various locations of interest in Wikipedia. Only dynamic pages should be listed here, no policy pages etc. ...

Telephone directory - Wikipedia, the free encyclopedia
"Phone book" and "White pages" redirect here. For a contact list, see Contact list . For other uses, see White pages (disambiguation) . Subscriber ...

Business Directory Listings: Eight Smart Tips for You to Get Started
If you are considering a business directory listing for your small business, congratulations – you are on the right track. Local SEO, local customers, ...

LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory
... continue reading at 9to5Mac . What do you think? Discuss "LinkedIn Lookup iOS app aims to replace your company’s awful intranet employee directory" ...

Atlas Partner Directory Launched
... just for Facebook and Instagram –advertising platform Atlas has one, as well. On that note, Atlas Tuesday introduced the Atlas Partner Directory ...

The British Library’s ‘Save Our Sounds’ Program Creates Directory of UK Sound Collections
The long-feared deterioration of the world's sound collections is a coming to a head with the British Library's last-ditch initiative called ...

Researchers show how to steal Windows Active Directory credentials from the Internet
... showed at the Black Hat security conference. The attack, called an SMB relay, causes a Windows computer that's part of an Active Directory ...

Researchers find way to steal Windows Active Directory credentials from the Internet
The technique could enable attackers to attack Windows servers hosted in the cloud

NorthPark at 50: Store directory from mall’s 1965 opening is a blast from the past
Grab a glass of wine, get on the phone with your best girlfriend from high school and check out this original map/directory of NorthPark Center. ...

Azure Active Directory Enables One-Step MDM in Windows 10
DAILY VIDEO: Microsoft enables one-step MDM in Windows 10; IRS breach more extensive than first reported; Georgia Tech finds 11 deep security ...

Resources last updated: 11/25/2015 10:50:59 AM