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:
- Get the "Specific Name" attribute.
- Get the segment from DN
- Change domain name from top
- Connect to LDAP: // [domain
Li> Repeat step 3 and change it to a forest name - You Know how
forestcan 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
Post a Comment