One movement with DsmlDirectoryIdentifier

We can hit the DsmlDirectory and
get the DsmlDirectoryIdentifier.

Following is the code to get the identification from the DSMLDirctory

Namespace Part

using System;
using System.Net;
using System.DirectoryServices;
using System.DirectoryServices.Protocols;

Code Part

public class MainClass {
public static void Main() {
Uri uri = new Uri("My URL");
DsmlDirectoryIdentifier identifier = new DsmlDirectoryIdentifier(uri);

NetworkCredential Mycredentials = new NetworkCredential();
Mycredentials.UserName = "yourName";
Mycredentials.Password = "password";

DsmlSoapHttpConnection connection = new DsmlSoapHttpConnection(identifier, Mycredentials);

string Mydistinguishedname = "My Name";
string MyldapFilter = "object=user";
string[] Myattributes = new string[1];

DirectoryRequest Myrequest = new SearchRequest(Mydistinguishedname, MyldapFilter, System.DirectoryServices.Protocols.SearchScope.Subtree, null);
DirectoryResponse Myresponse = connection.SendRequest(Myrequest);



Code Explanation

1. Create the URI
2. Create network credential
3. Create DsmlSoapHttpConnection
4. Make Directory request
5. Get Directory response



No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: