PrincipalContext.ValidateCredentials与使用NetBIOS名称受信任域慢 [英] PrincipalContext.ValidateCredentials slow with trusted domain using NetBios name

查看:378
本文介绍了PrincipalContext.ValidateCredentials与使用NetBIOS名称受信任域慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了验证使用System.DirectoryServices.AccountManagement对Active Directory凭据的服务。我需要验证对本地域证书以及信任域。在我的电脑上运行时的响应时间验证凭据是快速的本地和受信任域。当我提出这个服务,我们的服务器,本地域响应速度快但是,可信域响应很慢。(20 - 30秒)

I've created a service that validates credentials against Active Directory using System.DirectoryServices.AccountManagement. I need to validate credentials against the local domain as well as a trusted domain. The response time for validating credentials is fast for both the local and trusted domain when run on my computer. When I move this service to our server, the local domain response is fast however, the trusted domain response is very slow (20 - 30 seconds).

我还发现,如果我在PrincipalContext从NetBios名称更改域名的DNS命名为纠正性能问题的服务器上。

I've also found that if I change the domain name in the PrincipalContext from the NetBios name to the DNS name it corrects the the performance problem on the server.

下面是一些例子

PrincipalContext context = new PrincipalContext(ContextType.Domain, sNetBiosName)
context.ValidateCredentials(sUsername, sPassword)

在服务器上,上面会需要20-30秒,使用NetBIOS名称

On the server, the above will take 20-30 seconds using the NetBios Name

PrincipalContext context = new PrincipalContext(ContextType.Domain, sDNSName)
context.ValidateCredentials(sUsername, sPassword)

使用DNS名称的反应是0-2秒

Using the DNS name the response is 0-2 seconds

在哪些地方可以安装在服务器上的任何想法,使用NetBIOS名称加快这?

Any ideas on what needs to be setup on the server to speed this up using the NetBios name?

推荐答案

的NetBIOS是在大的网络出了名的慢。 这里解释如何NetBIOS名称解析工作。通常情况下,视窗三解决NETBIOS名称按以下顺序

NetBIOS is notoriously slow in the big network. Here explains how the NetBIOS name resolution works. Normally, Windows tris to resolve the NETBIOS name in the following order.

  1. 在本地缓存
  2. LMHOSTS文件
  3. 在WINS服务器
  4. 网络广播

所以,你可以看到一件事,可以提高NetBIOS名称解析速度是编辑LMHOSTS您的服务器上的文件,这样就可以完全以网络的方程。按照此 Microsoft知识库您的域和PDC添加到您的LMHOSTS文件。

So, you can see one thing that you can improve the NetBIOS name resolution speed is to edit the lmhosts file on your server, so that you can take the network completely out of the equation. Follow this Microsoft KB to add your domain and PDC to your lmhosts file.

这篇关于PrincipalContext.ValidateCredentials与使用NetBIOS名称受信任域慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆