摘要:
Table of ContentsIntroductionBackgroundPoints of concern: security & impersonationRunning code in batch processesMethod parmetersNotes for using System.DirectoryServices.DirectoryEntryTarget specific domain controllers or credentialsManaging local accounts with DirectoryEntryManaging local group 阅读全文
摘要:
public static class DomainInformation { #region Constants //static string[] usersLdapPath = @"LDAP://zzzzzz.com/OU=xxxxxx,DC=yyyyyy,DC=com"; static string usersLdapPath = System.Configuration.ConfigurationManager.AppSettings["LDAPConnectionString"].ToString() ; const string adLog 阅读全文
摘要:
1.在IIS中将访问方式更改为不允许匿名访问2.在Web.config中将验证方式更改为 <identity impersonate="true"/> <authentication mode="Windows" />3.在源代码中使用string username= Security.Principal.WindowsIdentity.GetCurrent().Namestring[] info = username.Split(new char[1] { '\\' }, StringSplitOptions.R 阅读全文