c# - Given a DirectoryEntry, how can I get the Forest object? -


Assume that I would like to apply an extension method which allows me to get one object for every directory entry object is.

My skeletal code:

  Public stable forest GetForest (DirectoryInterior Day) {string forestDnsName = //DoSomethingWith(de.Path); ? DirectoryContext References = New Directory Consultant (DirectoryContextType.Forest, forestDnsName); Return forest Guest (context)}  

But I'm sure how can I get a forest? Does anyone know how to get it?

There is no sample code, just a few simple steps:

  1. Get the "Specific Name" attribute.
  2. Get the segment from DN
  3. Change domain name from top
  4. Connect to LDAP: // [domain
  5. Li> Repeat step 3 and change it to a forest name
  6. You Know how forest can already be created by a forest name

If you call this extension method several times, you will be able to reduce Edi Traffic forest for Ekt can create a domain name for the map (skip steps 4-7).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -