<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FWeb_Services%2FActive_Directory</id>
		<title>Csharp/C Sharp/Web Services/Active Directory - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FWeb_Services%2FActive_Directory"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Web_Services/Active_Directory&amp;action=history"/>
		<updated>2026-04-30T01:11:13Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Web_Services/Active_Directory&amp;diff=6&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Web_Services/Active_Directory&amp;diff=6&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Web_Services/Active_Directory&amp;diff=7&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Web_Services/Active_Directory&amp;diff=7&amp;oldid=prev"/>
				<updated>2010-05-26T11:32:26Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==DirectoryEntry and DirectoryEntries==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class RemoveObject&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/ou=accounting, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
         &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
         AuthenticationTypes.ServerBind);&lt;br /&gt;
      DirectoryEntries children = de.Children;&lt;br /&gt;
      try&lt;br /&gt;
      {&lt;br /&gt;
         DirectoryEntry badObject = children.Find(&amp;quot;ou=auditing&amp;quot;);&lt;br /&gt;
         children.Remove(badObject);&lt;br /&gt;
         de.rumitChanges();&lt;br /&gt;
         Console.WriteLine(&amp;quot;the object was removed&amp;quot;);&lt;br /&gt;
      } catch (Exception)&lt;br /&gt;
      {&lt;br /&gt;
         Console.WriteLine(&amp;quot;the object was not found&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryEntry Get Properties==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class GetProperties&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
         &amp;quot;LDAP://192.168.1.100/cn=kblum, ou=sales, dc=ispnet1, dc=net&amp;quot;);&lt;br /&gt;
      Console.WriteLine(&amp;quot;object: {0}&amp;quot;, de.Path);&lt;br /&gt;
      PropertyCollection pc = de.Properties;&lt;br /&gt;
      foreach(string propName in pc.PropertyNames)&lt;br /&gt;
      {&lt;br /&gt;
         foreach(object value in de.Properties[propName])&lt;br /&gt;
            Console.WriteLine(&amp;quot;  property = {0}   value = {1}&amp;quot;,&lt;br /&gt;
               propName, value);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryEntry : List Objects==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class ListObjects&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/dc=ispnet1, dc=net&amp;quot;);&lt;br /&gt;
      Console.WriteLine(de.Path);&lt;br /&gt;
      DirectoryEntries des = de.Children;&lt;br /&gt;
      foreach(DirectoryEntry entry in des)&lt;br /&gt;
      {&lt;br /&gt;
         Console.WriteLine(&amp;quot;  child: &amp;quot; + entry.Name);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryEntry Rename Object==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class RenameObject&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/ou=auditing, ou=accounting, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
        &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
        AuthenticationTypes.ServerBind);&lt;br /&gt;
      DirectoryEntries des = de.Children;&lt;br /&gt;
      DirectoryEntry badObject = des.Find(&amp;quot;cn=test&amp;quot;);&lt;br /&gt;
      badObject.Rename(&amp;quot;cn=testing&amp;quot;);&lt;br /&gt;
      de.rumitChanges();&lt;br /&gt;
      de.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices: Add Object==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class AddObject&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/ou=accounting, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
         &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
         AuthenticationTypes.ServerBind);&lt;br /&gt;
      DirectoryEntries children = de.Children;&lt;br /&gt;
      DirectoryEntry newchild = children.Add(&amp;quot;ou=auditing&amp;quot;, de.SchemaClassName);&lt;br /&gt;
      newchild.Properties[&amp;quot;ou&amp;quot;].Add(&amp;quot;Auditing Department&amp;quot;);&lt;br /&gt;
      newchild.rumitChanges();&lt;br /&gt;
      newchild.Close();&lt;br /&gt;
      de.Close();&lt;br /&gt;
      DirectoryEntry de2 = new DirectoryEntry(&lt;br /&gt;
       &amp;quot;LDAP://192.168.1.100/ou=auditing, dc=accounting, dc=ispnet1, dc=net&amp;quot;);&lt;br /&gt;
      string newpath = de2.Path;&lt;br /&gt;
      Console.WriteLine(&amp;quot;new path: {0}&amp;quot;, newpath);&lt;br /&gt;
      de2.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices: Add Property==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class AddProperty&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/cn=kblum, ou=sales, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
        &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;,&amp;quot;password&amp;quot;,&lt;br /&gt;
        AuthenticationTypes.ServerBind);&lt;br /&gt;
      de.Properties[&amp;quot;telephoneNumber&amp;quot;].Add(&amp;quot;(111)222-3333&amp;quot;);&lt;br /&gt;
      de.Properties[&amp;quot;telephoneNumber&amp;quot;].Add(&amp;quot;(444)555-6666&amp;quot;);&lt;br /&gt;
      de.rumitChanges();&lt;br /&gt;
      de.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices Bind Object==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class BindObject&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
          &amp;quot;LDAP://192.168.1.100/dc=ispnet1, dc=net&amp;quot;);&lt;br /&gt;
      string ldappath = de.Path;&lt;br /&gt;
      Console.WriteLine(&amp;quot;The LDAP path is: {0}&amp;quot;, ldappath);&lt;br /&gt;
      de.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices: Delete Object==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class DeleteObject&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/ou=accounting, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
        &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
        AuthenticationTypes.ServerBind);&lt;br /&gt;
      DirectoryEntries children = de.Children;&lt;br /&gt;
      try&lt;br /&gt;
      {&lt;br /&gt;
         DirectoryEntry badObject = children.Find(&amp;quot;ou=auditing&amp;quot;);&lt;br /&gt;
         badObject.DeleteTree();&lt;br /&gt;
         de.rumitChanges();&lt;br /&gt;
         Console.WriteLine(&amp;quot;the object has been deleted&amp;quot;);&lt;br /&gt;
      } catch (Exception e)&lt;br /&gt;
      {&lt;br /&gt;
         Console.WriteLine(&amp;quot;the object was not found or deleted:&amp;quot;);&lt;br /&gt;
         Console.WriteLine(e.ToString());&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices DirectoryEntry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
using System.DirectoryServices.Protocols;&lt;br /&gt;
public class MainClass {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        using (DirectoryEntry de = new DirectoryEntry()) {&lt;br /&gt;
            de.Path = &amp;quot;LDAP://yourSite/rootDSE&amp;quot;;&lt;br /&gt;
            de.Username = @&amp;quot;explorer\chris&amp;quot;;&lt;br /&gt;
            de.Password = &amp;quot;password&amp;quot;;&lt;br /&gt;
            PropertyCollection props = de.Properties;&lt;br /&gt;
            foreach (string prop in props.PropertyNames) {&lt;br /&gt;
                PropertyValueCollection values = props[prop];&lt;br /&gt;
                foreach (string val in values) {&lt;br /&gt;
                    Console.Write(prop + &amp;quot;: &amp;quot;);&lt;br /&gt;
                    Console.WriteLine(val);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices GUI==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class UserSearchForm : Form {&lt;br /&gt;
    private string username;&lt;br /&gt;
    private string password;&lt;br /&gt;
    private string hostname;&lt;br /&gt;
    private string schemaNamingContext;&lt;br /&gt;
    private string defaultNamingContext;&lt;br /&gt;
    public UserSearchForm() {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    protected void SetLogonInformation() {&lt;br /&gt;
        username = (textBoxUsername.Text == &amp;quot;&amp;quot; ? null : textBoxUsername.Text);&lt;br /&gt;
        password = (textBoxPassword.Text == &amp;quot;&amp;quot; ? null : textBoxPassword.Text);&lt;br /&gt;
        hostname = textBoxHostname.Text;&lt;br /&gt;
        if (hostname != &amp;quot;&amp;quot;) hostname += &amp;quot;/&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    protected void SetNamingContext() {&lt;br /&gt;
        using (DirectoryEntry de = new DirectoryEntry()) {&lt;br /&gt;
            string path = &amp;quot;LDAP://&amp;quot; + hostname + &amp;quot;root&amp;quot;;&lt;br /&gt;
            de.Username = username;&lt;br /&gt;
            de.Password = password;&lt;br /&gt;
            de.Path = path;&lt;br /&gt;
            schemaNamingContext = de.Properties[&amp;quot;schemaNamingContext&amp;quot;][0].ToString();&lt;br /&gt;
            defaultNamingContext = de.Properties[&amp;quot;defaultNamingContext&amp;quot;][0].ToString();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    protected void SetUserProperties(string schemaNamingContext) {&lt;br /&gt;
        List&amp;lt;string&amp;gt; properties = new List&amp;lt;string&amp;gt;();&lt;br /&gt;
        string[] data = GetSchemaProperties(schemaNamingContext, &amp;quot;User&amp;quot;);&lt;br /&gt;
        properties.AddRange(GetSchemaProperties(schemaNamingContext, &amp;quot;Organizational-Person&amp;quot;));&lt;br /&gt;
        listBoxProperties.Items.Clear();&lt;br /&gt;
        foreach (string s in properties) {&lt;br /&gt;
            listBoxProperties.Items.Add(s);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    protected string[] GetSchemaProperties(string schemaNamingContext, string objectType) {&lt;br /&gt;
        string[] data;&lt;br /&gt;
        using (DirectoryEntry de = new DirectoryEntry()) {&lt;br /&gt;
            de.Username = username;&lt;br /&gt;
            de.Password = password;&lt;br /&gt;
            de.Path = &amp;quot;LDAP://&amp;quot; + hostname + &amp;quot;CN=&amp;quot; + objectType + &amp;quot;,&amp;quot; + schemaNamingContext;&lt;br /&gt;
            PropertyCollection properties = de.Properties;&lt;br /&gt;
            PropertyValueCollection values = properties[&amp;quot;systemMayContain&amp;quot;];&lt;br /&gt;
            data = new String[values.Count];&lt;br /&gt;
            values.CopyTo(data, 0);&lt;br /&gt;
        }&lt;br /&gt;
        return data;&lt;br /&gt;
    }&lt;br /&gt;
    private void OnLoadProperties(object sender, EventArgs e) {&lt;br /&gt;
        SetLogonInformation();&lt;br /&gt;
        SetNamingContext();&lt;br /&gt;
        SetUserProperties(schemaNamingContext);&lt;br /&gt;
    }&lt;br /&gt;
    private void OnSearch(object sender, EventArgs e) {&lt;br /&gt;
        FillResult();&lt;br /&gt;
    }&lt;br /&gt;
    protected string[] GetProperties() {&lt;br /&gt;
        string[] properties = new string[listBoxProperties.SelectedItems.Count];&lt;br /&gt;
        int i = 0;&lt;br /&gt;
        foreach (string s in listBoxProperties.SelectedItems) {&lt;br /&gt;
            properties[i++] = s;&lt;br /&gt;
        }&lt;br /&gt;
        return properties;&lt;br /&gt;
    }&lt;br /&gt;
    protected void FillResult() {&lt;br /&gt;
        using (DirectoryEntry root = new DirectoryEntry()) {&lt;br /&gt;
            root.Username = username;&lt;br /&gt;
            root.Password = password;&lt;br /&gt;
            root.Path = &amp;quot;LDAP://&amp;quot; + hostname + defaultNamingContext;&lt;br /&gt;
            using (DirectorySearcher searcher = new DirectorySearcher()) {&lt;br /&gt;
                searcher.SearchRoot = root;&lt;br /&gt;
                searcher.SearchScope = SearchScope.Subtree;&lt;br /&gt;
                searcher.Filter = textBoxFilter.Text;&lt;br /&gt;
                searcher.PropertiesToLoad.AddRange(GetProperties());&lt;br /&gt;
                SearchResultCollection results = searcher.FindAll();&lt;br /&gt;
                StringBuilder summary = new StringBuilder();&lt;br /&gt;
                foreach (SearchResult result in results) {&lt;br /&gt;
                    foreach (string propName in result.Properties.PropertyNames) {&lt;br /&gt;
                        foreach (string s in result.Properties[propName]) {&lt;br /&gt;
                            summary.Append(&amp;quot; &amp;quot; + propName + &amp;quot;: &amp;quot; + s + &amp;quot;\r\n&amp;quot;);&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    summary.Append(&amp;quot;\r\n&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                textBoxResults.Text = summary.ToString();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private void InitializeComponent() {&lt;br /&gt;
        this.splitContainer1 = new System.Windows.Forms.SplitContainer();&lt;br /&gt;
        this.buttonSearch = new System.Windows.Forms.Button();&lt;br /&gt;
        this.label9 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.textBoxFilter = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.label8 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.label7 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.listBoxProperties = new System.Windows.Forms.ListBox();&lt;br /&gt;
        this.label6 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.buttonLoadProperties = new System.Windows.Forms.Button();&lt;br /&gt;
        this.label5 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.groupBox1 = new System.Windows.Forms.GroupBox();&lt;br /&gt;
        this.textBoxPassword = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.textBoxUsername = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.label4 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.label3 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.textBoxHostname = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.label2 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.label1 = new System.Windows.Forms.Label();&lt;br /&gt;
        this.textBoxResults = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.splitContainer1.Panel1.SuspendLayout();&lt;br /&gt;
        this.splitContainer1.Panel2.SuspendLayout();&lt;br /&gt;
        this.splitContainer1.SuspendLayout();&lt;br /&gt;
        this.groupBox1.SuspendLayout();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        // &lt;br /&gt;
        // splitContainer1&lt;br /&gt;
        // &lt;br /&gt;
        this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;&lt;br /&gt;
        this.splitContainer1.Location = new System.Drawing.Point(0, 0);&lt;br /&gt;
        this.splitContainer1.Name = &amp;quot;splitContainer1&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // Panel1&lt;br /&gt;
        // &lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.buttonSearch);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label9);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.textBoxFilter);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label8);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label7);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.listBoxProperties);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label6);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.buttonLoadProperties);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label5);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.groupBox1);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.textBoxHostname);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label2);&lt;br /&gt;
        this.splitContainer1.Panel1.Controls.Add(this.label1);&lt;br /&gt;
        // &lt;br /&gt;
        // Panel2&lt;br /&gt;
        // &lt;br /&gt;
        this.splitContainer1.Panel2.Controls.Add(this.textBoxResults);&lt;br /&gt;
        this.splitContainer1.Size = new System.Drawing.Size(721, 550);&lt;br /&gt;
        this.splitContainer1.SplitterDistance = 370;&lt;br /&gt;
        this.splitContainer1.TabIndex = 0;&lt;br /&gt;
        this.splitContainer1.Text = &amp;quot;splitContainer1&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // buttonSearch&lt;br /&gt;
        // &lt;br /&gt;
        this.buttonSearch.Location = new System.Drawing.Point(190, 489);&lt;br /&gt;
        this.buttonSearch.Name = &amp;quot;buttonSearch&amp;quot;;&lt;br /&gt;
        this.buttonSearch.TabIndex = 12;&lt;br /&gt;
        this.buttonSearch.Text = &amp;quot;Search&amp;quot;;&lt;br /&gt;
        this.buttonSearch.Click += new System.EventHandler(this.OnSearch);&lt;br /&gt;
        // &lt;br /&gt;
        // label9&lt;br /&gt;
        // &lt;br /&gt;
        this.label9.AutoSize = true;&lt;br /&gt;
        this.label9.Location = new System.Drawing.Point(22, 489);&lt;br /&gt;
        this.label9.Name = &amp;quot;label9&amp;quot;;&lt;br /&gt;
        this.label9.Size = new System.Drawing.Size(98, 14);&lt;br /&gt;
        this.label9.TabIndex = 11;&lt;br /&gt;
        this.label9.Text = &amp;quot;5. Start the Search&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // textBoxFilter&lt;br /&gt;
        // &lt;br /&gt;
        this.textBoxFilter.Location = new System.Drawing.Point(190, 445);&lt;br /&gt;
        this.textBoxFilter.Name = &amp;quot;textBoxFilter&amp;quot;;&lt;br /&gt;
        this.textBoxFilter.TabIndex = 10;&lt;br /&gt;
        this.textBoxFilter.Text = &amp;quot;(objectClass=user)&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // label8&lt;br /&gt;
        // &lt;br /&gt;
        this.label8.AutoSize = true;&lt;br /&gt;
        this.label8.Location = new System.Drawing.Point(22, 452);&lt;br /&gt;
        this.label8.Name = &amp;quot;label8&amp;quot;;&lt;br /&gt;
        this.label8.Size = new System.Drawing.Size(33, 14);&lt;br /&gt;
        this.label8.TabIndex = 9;&lt;br /&gt;
        this.label8.Text = &amp;quot;Filter:&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // label7&lt;br /&gt;
        // &lt;br /&gt;
        this.label7.AutoSize = true;&lt;br /&gt;
        this.label7.Location = new System.Drawing.Point(22, 420);&lt;br /&gt;
        this.label7.Name = &amp;quot;label7&amp;quot;;&lt;br /&gt;
        this.label7.Size = new System.Drawing.Size(127, 14);&lt;br /&gt;
        this.label7.TabIndex = 8;&lt;br /&gt;
        this.label7.Text = &amp;quot;4. Enter the LDAP Filter:&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // listBoxProperties&lt;br /&gt;
        // &lt;br /&gt;
        this.listBoxProperties.FormattingEnabled = true;&lt;br /&gt;
        this.listBoxProperties.Location = new System.Drawing.Point(190, 289);&lt;br /&gt;
        this.listBoxProperties.Name = &amp;quot;listBoxProperties&amp;quot;;&lt;br /&gt;
        this.listBoxProperties.Size = new System.Drawing.Size(120, 95);&lt;br /&gt;
        this.listBoxProperties.TabIndex = 7;&lt;br /&gt;
        // &lt;br /&gt;
        // label6&lt;br /&gt;
        // &lt;br /&gt;
        this.label6.AutoSize = true;&lt;br /&gt;
        this.label6.Location = new System.Drawing.Point(22, 289);&lt;br /&gt;
        this.label6.Name = &amp;quot;label6&amp;quot;;&lt;br /&gt;
        this.label6.Size = new System.Drawing.Size(129, 27);&lt;br /&gt;
        this.label6.TabIndex = 6;&lt;br /&gt;
        this.label6.Text = &amp;quot;3. Choose the Properties \r\nto Display&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // buttonLoadProperties&lt;br /&gt;
        // &lt;br /&gt;
        this.buttonLoadProperties.Location = new System.Drawing.Point(190, 238);&lt;br /&gt;
        this.buttonLoadProperties.Name = &amp;quot;buttonLoadProperties&amp;quot;;&lt;br /&gt;
        this.buttonLoadProperties.Size = new System.Drawing.Size(116, 23);&lt;br /&gt;
        this.buttonLoadProperties.TabIndex = 5;&lt;br /&gt;
        this.buttonLoadProperties.Text = &amp;quot;Load Properties&amp;quot;;&lt;br /&gt;
        this.buttonLoadProperties.Click += new System.EventHandler(this.OnLoadProperties);&lt;br /&gt;
        // &lt;br /&gt;
        // label5&lt;br /&gt;
        // &lt;br /&gt;
        this.label5.AutoSize = true;&lt;br /&gt;
        this.label5.Location = new System.Drawing.Point(29, 238);&lt;br /&gt;
        this.label5.Name = &amp;quot;label5&amp;quot;;&lt;br /&gt;
        this.label5.Size = new System.Drawing.Size(118, 14);&lt;br /&gt;
        this.label5.TabIndex = 4;&lt;br /&gt;
        this.label5.Text = &amp;quot;2. Load the Properties:&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // groupBox1&lt;br /&gt;
        // &lt;br /&gt;
        this.groupBox1.Controls.Add(this.textBoxPassword);&lt;br /&gt;
        this.groupBox1.Controls.Add(this.textBoxUsername);&lt;br /&gt;
        this.groupBox1.Controls.Add(this.label4);&lt;br /&gt;
        this.groupBox1.Controls.Add(this.label3);&lt;br /&gt;
        this.groupBox1.Location = new System.Drawing.Point(22, 115);&lt;br /&gt;
        this.groupBox1.Name = &amp;quot;groupBox1&amp;quot;;&lt;br /&gt;
        this.groupBox1.Size = new System.Drawing.Size(304, 100);&lt;br /&gt;
        this.groupBox1.TabIndex = 3;&lt;br /&gt;
        this.groupBox1.TabStop = false;&lt;br /&gt;
        this.groupBox1.Text = &amp;quot;Logon [optional]&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // textBoxPassword&lt;br /&gt;
        // &lt;br /&gt;
        this.textBoxPassword.Location = new System.Drawing.Point(168, 60);&lt;br /&gt;
        this.textBoxPassword.Name = &amp;quot;textBoxPassword&amp;quot;;&lt;br /&gt;
        this.textBoxPassword.PasswordChar = &amp;quot;*&amp;quot;;&lt;br /&gt;
        this.textBoxPassword.Size = new System.Drawing.Size(116, 20);&lt;br /&gt;
        this.textBoxPassword.TabIndex = 3;&lt;br /&gt;
        // &lt;br /&gt;
        // textBoxUsername&lt;br /&gt;
        // &lt;br /&gt;
        this.textBoxUsername.Location = new System.Drawing.Point(168, 23);&lt;br /&gt;
        this.textBoxUsername.Name = &amp;quot;textBoxUsername&amp;quot;;&lt;br /&gt;
        this.textBoxUsername.Size = new System.Drawing.Size(116, 20);&lt;br /&gt;
        this.textBoxUsername.TabIndex = 2;&lt;br /&gt;
        // &lt;br /&gt;
        // label4&lt;br /&gt;
        // &lt;br /&gt;
        this.label4.AutoSize = true;&lt;br /&gt;
        this.label4.Location = new System.Drawing.Point(7, 60);&lt;br /&gt;
        this.label4.Name = &amp;quot;label4&amp;quot;;&lt;br /&gt;
        this.label4.Size = new System.Drawing.Size(57, 14);&lt;br /&gt;
        this.label4.TabIndex = 1;&lt;br /&gt;
        this.label4.Text = &amp;quot;Password:&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // label3&lt;br /&gt;
        // &lt;br /&gt;
        this.label3.AutoSize = true;&lt;br /&gt;
        this.label3.Location = new System.Drawing.Point(7, 29);&lt;br /&gt;
        this.label3.Name = &amp;quot;label3&amp;quot;;&lt;br /&gt;
        this.label3.Size = new System.Drawing.Size(60, 14);&lt;br /&gt;
        this.label3.TabIndex = 0;&lt;br /&gt;
        this.label3.Text = &amp;quot;Username:&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // textBoxHostname&lt;br /&gt;
        // &lt;br /&gt;
        this.textBoxHostname.Location = new System.Drawing.Point(190, 70);&lt;br /&gt;
        this.textBoxHostname.Name = &amp;quot;textBoxHostname&amp;quot;;&lt;br /&gt;
        this.textBoxHostname.Size = new System.Drawing.Size(136, 20);&lt;br /&gt;
        this.textBoxHostname.TabIndex = 2;&lt;br /&gt;
        // &lt;br /&gt;
        // label2&lt;br /&gt;
        // &lt;br /&gt;
        this.label2.AutoSize = true;&lt;br /&gt;
        this.label2.Location = new System.Drawing.Point(22, 70);&lt;br /&gt;
        this.label2.Name = &amp;quot;label2&amp;quot;;&lt;br /&gt;
        this.label2.Size = new System.Drawing.Size(145, 14);&lt;br /&gt;
        this.label2.TabIndex = 1;&lt;br /&gt;
        this.label2.Text = &amp;quot;Domain Controller [optional]&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        this.label1.AutoSize = true;&lt;br /&gt;
        this.label1.Location = new System.Drawing.Point(22, 31);&lt;br /&gt;
        this.label1.Name = &amp;quot;label1&amp;quot;;&lt;br /&gt;
        this.label1.Size = new System.Drawing.Size(254, 14);&lt;br /&gt;
        this.label1.TabIndex = 0;&lt;br /&gt;
        this.label1.Text = &amp;quot;1. Enter Domain Controller and Logon Information&amp;quot;;&lt;br /&gt;
        // &lt;br /&gt;
        // textBoxResults&lt;br /&gt;
        // &lt;br /&gt;
        this.textBoxResults.Dock = System.Windows.Forms.DockStyle.Fill;&lt;br /&gt;
        this.textBoxResults.Location = new System.Drawing.Point(0, 0);&lt;br /&gt;
        this.textBoxResults.Multiline = true;&lt;br /&gt;
        this.textBoxResults.Name = &amp;quot;textBoxResults&amp;quot;;&lt;br /&gt;
        this.textBoxResults.Size = new System.Drawing.Size(347, 550);&lt;br /&gt;
        this.textBoxResults.TabIndex = 0;&lt;br /&gt;
        // &lt;br /&gt;
        // UserSearchForm&lt;br /&gt;
        // &lt;br /&gt;
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
        this.ClientSize = new System.Drawing.Size(721, 550);&lt;br /&gt;
        this.Controls.Add(this.splitContainer1);&lt;br /&gt;
        this.Name = &amp;quot;UserSearchForm&amp;quot;;&lt;br /&gt;
        this.Text = &amp;quot;User Search&amp;quot;;&lt;br /&gt;
        this.splitContainer1.Panel1.ResumeLayout(false);&lt;br /&gt;
        this.splitContainer1.Panel1.PerformLayout();&lt;br /&gt;
        this.splitContainer1.Panel2.ResumeLayout(false);&lt;br /&gt;
        this.splitContainer1.Panel2.PerformLayout();&lt;br /&gt;
        this.splitContainer1.ResumeLayout(false);&lt;br /&gt;
        this.groupBox1.ResumeLayout(false);&lt;br /&gt;
        this.groupBox1.PerformLayout();&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    private System.Windows.Forms.SplitContainer splitContainer1;&lt;br /&gt;
    private System.Windows.Forms.TextBox textBoxHostname;&lt;br /&gt;
    private System.Windows.Forms.Label label2;&lt;br /&gt;
    private System.Windows.Forms.Label label1;&lt;br /&gt;
    private System.Windows.Forms.GroupBox groupBox1;&lt;br /&gt;
    private System.Windows.Forms.TextBox textBoxUsername;&lt;br /&gt;
    private System.Windows.Forms.Label label4;&lt;br /&gt;
    private System.Windows.Forms.Label label3;&lt;br /&gt;
    private System.Windows.Forms.TextBox textBoxPassword;&lt;br /&gt;
    private System.Windows.Forms.Button buttonLoadProperties;&lt;br /&gt;
    private System.Windows.Forms.Label label5;&lt;br /&gt;
    private System.Windows.Forms.Label label6;&lt;br /&gt;
    private System.Windows.Forms.ListBox listBoxProperties;&lt;br /&gt;
    private System.Windows.Forms.TextBox textBoxFilter;&lt;br /&gt;
    private System.Windows.Forms.Label label8;&lt;br /&gt;
    private System.Windows.Forms.Label label7;&lt;br /&gt;
    private System.Windows.Forms.Button buttonSearch;&lt;br /&gt;
    private System.Windows.Forms.Label label9;&lt;br /&gt;
    private System.Windows.Forms.TextBox textBoxResults;&lt;br /&gt;
&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() {&lt;br /&gt;
        Application.EnableVisualStyles();&lt;br /&gt;
        Application.Run(new UserSearchForm());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices:Modify Property ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class ModifyProperty&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
         &amp;quot;LDAP://192.168.1.100/cn=kblum, ou=sales, dc=ispnet1, dc=net&amp;quot;,&lt;br /&gt;
         &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
          AuthenticationTypes.ServerBind);&lt;br /&gt;
      de.Properties[&amp;quot;sn&amp;quot;][0] = &amp;quot;Mullen&amp;quot;;&lt;br /&gt;
      de.rumitChanges();&lt;br /&gt;
      Console.WriteLine(&amp;quot;New property value: {0}&amp;quot;, de.Properties[&amp;quot;sn&amp;quot;][0]);&lt;br /&gt;
      de.Close();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DirectoryServices: Simple Search==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class SimpleSearch&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      DirectoryEntry root = new DirectoryEntry(&lt;br /&gt;
        &amp;quot;LDAP://192.168.1.100/DC=ispnet1,DC=net&amp;quot;,&lt;br /&gt;
        &amp;quot;cn=Administrator, dc=ispnet1, dc=net&amp;quot;, &amp;quot;password&amp;quot;,&lt;br /&gt;
        AuthenticationTypes.ServerBind);&lt;br /&gt;
      DirectorySearcher searcher = new DirectorySearcher(root);&lt;br /&gt;
      searcher.Filter = &amp;quot;(&amp;amp;(objectClass=person)(sn=Blum))&amp;quot;;&lt;br /&gt;
      searcher.PropertiesToLoad.Add(&amp;quot;cn&amp;quot;);&lt;br /&gt;
      searcher.PropertiesToLoad.Add(&amp;quot;telephoneNumber&amp;quot;);&lt;br /&gt;
      SearchResultCollection results = searcher.FindAll();&lt;br /&gt;
      foreach(SearchResult result in results)&lt;br /&gt;
      {&lt;br /&gt;
         string searchpath = result.Path;&lt;br /&gt;
         Console.WriteLine(&amp;quot;path: {0}&amp;quot;, searchpath);&lt;br /&gt;
         ResultPropertyCollection rpc = result.Properties;&lt;br /&gt;
         foreach(string property in rpc.PropertyNames)&lt;br /&gt;
         {&lt;br /&gt;
            foreach(object value in rpc[property])&lt;br /&gt;
               Console.WriteLine(&amp;quot;  property = {0}  value = {1}&amp;quot;, property, value);&lt;br /&gt;
         }&lt;br /&gt;
      } &lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==retrieves Active Directory information==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
public class Example21_16 &lt;br /&gt;
{&lt;br /&gt;
  public static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    // connect to AD&lt;br /&gt;
    DirectoryEntry de = new DirectoryEntry(&lt;br /&gt;
      &amp;quot;WinNT://DomanName/MachineName&amp;quot;, &amp;quot;Administrator&amp;quot;, &amp;quot;Password&amp;quot;);&lt;br /&gt;
    foreach(DirectoryEntry child in de.Children) &lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(child.SchemaClassName + &amp;quot;: &amp;quot; + child.Name);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using DirectorySearcher==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.DirectoryServices;&lt;br /&gt;
&lt;br /&gt;
public class MainClass {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        using (DirectoryEntry de = new DirectoryEntry(&amp;quot;LDAP://yourV/OU=yourV, DC=explorer, DC=local&amp;quot;))&lt;br /&gt;
        using (DirectorySearcher searcher = new DirectorySearcher()) {&lt;br /&gt;
            de.Username = @&amp;quot;explorer\yourName&amp;quot;;&lt;br /&gt;
            de.Password = &amp;quot;password&amp;quot;;&lt;br /&gt;
            searcher.SearchRoot = de;&lt;br /&gt;
            searcher.Filter = &amp;quot;(&amp;amp;(objectClass=user)(description=Auth*))&amp;quot;;&lt;br /&gt;
            searcher.SearchScope = System.DirectoryServices.SearchScope.Subtree;&lt;br /&gt;
            searcher.PropertiesToLoad.Add(&amp;quot;name&amp;quot;);&lt;br /&gt;
            searcher.PropertiesToLoad.Add(&amp;quot;description&amp;quot;);&lt;br /&gt;
            searcher.PropertiesToLoad.Add(&amp;quot;givenName&amp;quot;);&lt;br /&gt;
            searcher.PropertiesToLoad.Add(&amp;quot;wWWHomePage&amp;quot;);&lt;br /&gt;
            searcher.Sort = new SortOption(&amp;quot;givenName&amp;quot;, SortDirection.Ascending);&lt;br /&gt;
            SearchResultCollection results = searcher.FindAll();&lt;br /&gt;
            foreach (SearchResult result in results) {&lt;br /&gt;
                ResultPropertyCollection props = result.Properties;&lt;br /&gt;
                foreach (string propName in props.PropertyNames) {&lt;br /&gt;
                    Console.Write(propName + &amp;quot;: &amp;quot;);&lt;br /&gt;
                    Console.WriteLine(props[propName][0]);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>