获取可用域的列表(NT4 和 Active Directory)

发布于 2024-07-05 00:24:00 字数 284 浏览 5 评论 0原文

有谁知道(在c#中)获取可用NT4域的方法(有点像WinXP登录框下拉菜单)?

我知道这对于使用 DirectoryServices 命名空间的 Active Directory 来说相当容易,但我找不到旧 NT4 域的任何内容。 如果可能的话,我宁愿不使用 API 调用(但这可能要求有点高)。

另外,为了奖励积分(!),我们最终将在今年秋天晚些时候切换到 Active Directory,那么当我们迁移时,我将如何构建一种将我的域列表自动从 NT4 切换到 AD 的方法(所以我不需要重新编译并重新发布)

Does anyone know (in c#) a way of getting the available NT4 domains (a bit like the WinXP login box dropdown)?

I know that this is fairly easy for Active Directory using the DirectoryServices namespace, but I can't find anything for the old NT4 domains. I'd rather not use API calls if at all possible (that might be asking a bit much however).

Also, for bonus points (!), we are finally switching to Active Directory later on this autumn, so how would I construct a way of my domain list automatically switching over from NT4 to AD, when we migrate (so I don't need to recompile and re-release)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞清仓 2024-07-12 00:24:00

不幸的是,我认为您唯一的选择是使用 ADSI API。 您可以通过更改代码中的提供程序在 NT4 和 Active Directory 之间切换。 NT4 使用 WinNT 提供程序,Active Directory 使用 LDAP 提供程序。

如果您查询您正在使用的任何提供程序的 RootDSE 节点,它应该返回您可以绑定的命名上下文,包括域。 RootDSE 是 LDAP 模式特定的标识符。 对于 WinNT,您可以将根对象查询为“WinNT:”以获取可用域。

顺便说一句,ADSI 可通过 VB 脚本获得。

Unfortunately I think your only option is to use the ADSI API. You can switch between NT4 and Active Directory by changing providers in your code. NT4 uses the WinNT provider and Active Directory uses the LDAP provider.

If you query the RootDSE node of whichever provider you are using, that should return naming contexts to which you can bind, including domains. RootDSE is an LDAP schema specific identifier. For WinNT you can query the root object as "WinNT:" to get available domains.

ADSI is available through VB script BTW.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文