There is an incompatibility between the
ADSI COM
interfaces and the DLR that prevents using the dynamic keyword.
More information is available at the following Stack Overflow question: Why does dynamic method invoke fail when reflection still works?
This package provides a managed implementation to the various ADSI Data Types and Constants, Structures, Enumerations, Functions, Interfaces, System Providers, Error Codes, and Extended Error Messages It also provides some convenient overrides for the methods to allow the default ADSI behaviors without having to explicitly specify those parameters. Currently the library targets .NET 2.0 and has been tested and used with the 4.0 framework without issues.
The following code uses the current user identity as an NT-style login string (domain\user) and converts it to an RFC 1779 distinguished name format:
var principal = WindowsIdentity.GetCurrent();
var nto = new NameTranslate();
var dn = nto.Translate(principal.Name, ADS_NAME_TYPE.ADS_NAME_TYPE_1779);
- 0.1 - Initial
NameTranslatesupport and NuGet package - ...
- 1.0 - Complete wrappers for all ADSI enumerations, interfaces and objects
- Kate England for an attribution free icon that looks great with this project. I have never met you and we may never interact - but you have my deep gratitude!
