如何查明计算机是否连接到 Novell eDirectory 或 Microsoft ActiveDirectory?
我刚刚在我的应用程序中实现了 Novell eDirectory。由于我们的应用程序支持 Microsoft ActiveDirectory,我想阻止其他配置参数,例如“Novell yes/no”。
那么,是否有其他方法可以查明计算机是否连接到 Microsoft ActiveDirectory 或 Novell 网络?
I just implemented Novell eDirectory in my application. Since our application supports Microsoft ActiveDirectory I would like to prevent an additional configuration parameter like "Novell yes/no".
So, is there another way to find out if the computer is connected to a Microsoft ActiveDirectory or a Novell network?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想知道计算机是否属于 Windows 域,您可以获取
Win32_NTDomain
WMI 信息。在 powerShell 中,它给出:
根据 @ScottTx 注释的版本,您还可以使用
Win32_ComputerSystem
WMI 类根据到 C# 中的 Win32_NTDomain 类文档您可以通过以下方式获取它:
添加对
System.Management
程序集的引用I you want to know if a computer is part of a Windows domain you can get the
Win32_NTDomain
WMI information.In powerShell it gives :
Edition according to @ScottTx comment you can also use
Win32_ComputerSystem
WMI classAccording to Win32_NTDomain class documentation in C# you can get it by :
Adding a reference to
System.Management
assembly嗯,像“连接到 Novell 网络”这样的说法比以前模糊得多。如果使用 Novell (Netware) 客户端的工作站上的用户登录到 Netware 服务器或提供 NCP(Netware 核心协议)之类服务(例如 Linux 上的 OES)的服务器,则仅当用户登录时,Edirectory 中的网络地址属性才应存在当前已登录到 EDirectory (NDS)。
有时,由于客户端有问题,如果用户登录,则该属性不存在,但通常您可以使用该属性。用户登录 AD 和 AD 也是完全正常的。同时进行NDS。此外,根据配置或使用的 Novell 产品,工作站本身也可以记录到 NDS。
Well a statement like "being connected to a Novell network" is a lot vaguer then it used to be. If a user on a workstation using the Novell (Netware) client is logged into a netware server or a server offering NCP (Netware Core Protocol) like services such as OES on linux then the Network Address Attribute in Edirectory should only be present if the user is currently logged into EDirectory (NDS).
Some times due to a buggy client this attribute is not present if a user is logged in but generally that attribute is what you can use. Also it is entirely normal for user to be logged into AD & NDS at the same time. Also the workstation itself can also be logged to NDS depending on configuration or Novell products in use.
你如何连接?通过 LDAP?如果是这样,请查找 sAMAccountName,它是 Active Directory 所特有的。 AD 中的每个用户和组都将具有该属性(这是强制性的)。而在 eDirectory 中,没有人会拥有它,除非他们奇怪地扩展了 eDirectory 架构来添加它。
RootDSE 中可能有一些内容可以指示哪个是您的源目录。但我不确定有什么好的例子。
How are you connecting? Via LDAP? If so, look for sAMAccountName and that is unique to Active Directory. Every user and group in AD will have that attribute (It is mandatory). Whereas in eDirectory no one will have it, unless they oddly extended the eDirectory schema to add it.
There is probably something in the RootDSE that will indicate which is your source directory. But I am not sure of a great example offhand.