Solved

Listing all of the System.DirectoryServices.DirectoryEntry objects properties

Posted on 2004-09-17
2
515 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now