• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

Active Directory - User List/Modification

Hi.

Please note I'm programming in VB.NET and not classic ASP or C#
Here's what I need. I need to create web (VB.NET) application that will access Active Drictory and dispaly all current users (user list).  I want to retreive acouts from specific OUs (OU1, OU2) and some user acouts should not be in the list (like: previous employees, disable acounts, system acounts, etc).
When user is clicked (can be a link) I need to provide a way to update his/her information.

And one more thing. Later on we would like to use this kind of approach with SharePoint MOSS 2007. Is it possible to do so and what would be approach to accomplish this task? I never had a chance to work with SharePoint and my knowledge of it is very basic (I know what it's for).

Thank you,
0
IOIT
Asked:
IOIT
1 Solution
 
wizard_340Commented:
Your first "question" is a very open-ended.  A little Google goes a long way to starting your application:
http://www.15seconds.com/issue/020730.htm
http://www.codeproject.com/aspnet/adsi2.asp
Unfortunately, AD is rather explicit and environments can differ according to administrative styles.  Finding all active users and gathering their name, email address, class memberships (for possibly qualifying system accounts), their GUID, and manager, for example:

<code>
            Static strActiveOnly As String = "(&(objectCategory=user)(objectClass=user)(!UserAccountControl:1.2.840.113556.1.4.803:=2))"
            Dim adRoot As New DirectoryServices.DirectoryEntry("LDAP://daldc1.tarragoncorp.local/DC=tarragoncorp,DC=local")
            With adRoot
                .Username = Nothing
                .Password = Nothing
                .AuthenticationType = DirectoryServices.AuthenticationTypes.Delegation
            End With
            Dim adUserSearcher As New DirectoryServices.DirectorySearcher(adRoot, strActiveOnly)
            With adUserSearcher
                .SearchScope = DirectoryServices.SearchScope.Subtree
                .PageSize = 1000
                .PropertiesToLoad.Add("displayName")
                .PropertiesToLoad.Add("mail")
                .PropertiesToLoad.Add("objectClass")
                .PropertiesToLoad.Add("objectGUID")
                .PropertiesToLoad.Add("manager")
            End With
                Dim adUserResults As DirectoryServices.SearchResultCollection = adUserSearcher.FindAll
</code>

Filtering your results will be dependant on your AD environment, and how users have been assigned/distinguished, so only specific questions could be answered.

As to your second question, yes you can code web parts to include in MOSS.  It's already heavilly dependant on active directory for its security, so including something like this is not uncommon - out of the box, SharePoint already includes the capicity to email between one another based on the email address imported from AD.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now