C#操作域用户
using System; using System.DirectoryServices; namespace SystemFrameworks.Helper { /// ///活动目录辅助类。封装一系列活动目录操作相关的方法。 /// public sealed class ADHelper { /// ///域名 /// private static string DomainName = "MyDomain"; /// /// LDAP 地址 /// private static string LDAPDomain = "DC=MyDomain,DC=local"; /// /// LDAP绑定路径 /// private static string ADPath = "LDAP://brooks.mydomain.local"; /// ///登录帐号 /// private static string ADUser = "Administrator"; /// ///登录密码 /// private static string ADPassword = "password"; /// ///扮演类实例 /// private static IdentityImpersonation impersonate = new IdentityImpersonation