Solved

Listing all of the System.DirectoryServices.DirectoryEntry objects properties

Posted on 2004-09-17
2
528 Views
Last Modified: 2008-02-01
Hi,
I'm wondering how to list every single property in a textbox of System.DirectoryServices.DirectoryEntry.Properties. The list only takes a name of a property and further I'm not entirely sure what the property contains. Another list? Thanks for any help.
0
Comment
Question by:xersoft
2 Comments
 
LVL 3

Accepted Solution

by:
mpemberton5 earned 50 total points
ID: 12102004
Are you looking for something like this?

        Dim ldapCommand As String
        ldapCommand = "LDAP://ad/OU=testorg,OU=clients,DC=yourdomain,DC=com"
        Dim de As DirectoryEntry = New DirectoryEntry(ldapCommand)
        Dim obEntry As DirectoryEntry = New DirectoryEntry(ldapCommand)
        Dim srch As DirectorySearcher = New DirectorySearcher(obEntry, "(&(objectClass=user)(samAccountName=" & AccountName & "))")
        Dim rescol As SearchResultCollection = srch.FindAll
        Dim res As SearchResult
        For Each res In rescol

            Dim item As String
            For Each item In res.Properties.PropertyNames
                Response.Write(item.ToString & " - ")
                Response.Write(res.Properties(item.ToString)(0).ToString)
                Response.Write("<BR>")
            Next
            Response.Write("<BR>")
        '''Next
0
 
LVL 5

Author Comment

by:xersoft
ID: 12102137
Properties.PropertyNames ahh I see, don't know why I didn't see that before. But this is perfect. I can look at each property name. Thanks for the help!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question