奇怪的是,在本地主机上托管时,我可以从服务器获取 AD 列表,但是当在服务器 2008 R2 上托管时,它返回错误,我使用的是 LinqToLDAP,知道实际出了什么问题吗?
var config = new LdapConfiguration();
config.ConfigureFactory(Server).ProtocolVersion(3);
config.MaxPageSizeIs(Size);
using (HostingEnvironment.Impersonate()) //solved issue for firefox and safari
{
using (var context = new DirectoryContext(config))
{
context.Log = Console.Out;
var user = context.Query<ActiveDirectory>();
var result = (from m in user
select m).ToList();
return result;
}
}