How do I know if my computer is connected to Novell eDirectory or Microsoft ActiveDirectory?

I just applied Novell eDirectory in my application. Since our application supports Microsoft ActiveDirectory, I would like to prevent an additional configuration parameter, such as "Novell yes / no".

So, is there another way to find out if a computer is connected to Microsoft ActiveDirectory or a Novell network?

+4
source share
3 answers

I want to know if the computer is part of the Windows domain, you can get information about WMI Win32_NTDomain .

In powerShell, it gives:

 Get-WmiObject Win32_NTDomain ClientSiteName : Default-First-Site-Name DcSiteName : Default-First-Site-Name Description : DOM DnsForestName : dom.fr DomainControllerAddress : \\192.168.183.100 DomainControllerName : \\WM2008R2ENT DomainName : DOM Roles : Status : OK 

Edition according to @ScottTx comment you can also use the Win32_ComputerSystem WMI class

 PS> (Get-WMIObject Win32_ComputerSystem).PartOfDomain False 

According to the Win32_NTDomain Class Documentation in C # you can get it:

 using System; using System.Collections.Generic; using System.Text; using System.Management; namespace WMIQuery { class WmiQuery { static void Main(string[] args) { ManagementObjectSearcher domainInfos = new ManagementObjectSearcher("select * from WIN32_NTDomain"); foreach (ManagementObject domainInfo in domainInfos.Get()) { Console.WriteLine("Name : {0}", domainInfo.GetPropertyValue("Name")); Console.WriteLine("Computer/domain : {0}", domainInfo.GetPropertyValue("Caption")); Console.WriteLine("Domain name : {0}", domainInfo.GetPropertyValue("DomainName")); Console.WriteLine("Status : {0}", domainInfo.GetPropertyValue("Status")); } // Edition according to @ScottTx comment you can also use `Win32_ComputerSystem` WMI class ManagementObjectSearcher ComputerInfos = new ManagementObjectSearcher("select * from Win32_ComputerSystem"); foreach (ManagementObject ComputerInfo in ComputerInfos.Get()) { if ((bool)ComputerInfo.GetPropertyValue("PartOfDomain")) Console.WriteLine("This computer is part of domain"); else Console.WriteLine("This computer is not part of domain"); } } } } 

Adding a link to System.Management assembly

+2
source

Well, a statement like “Novell network connectivity” is much vague than before. If a user at a workstation using a Novell client (Netware) logs on to a netware server or to a server offering NCP (Netware Core Protocol), such as services such as OES for Linux, then the network address attribute in Edirectory should only be present if if the user is currently registered with EDirectory (NDS).

Several times due to a malfunctioning client, this attribute is absent if the user is registered, but usually this attribute is used by you. It is also quite normal that the user is simultaneously registered in AD and NDS. Also, the workstation itself can also be registered with NDS, depending on the configuration or Novell products used.

+1
source

How do you connect? Through LDAP? If so, look for the name sAMAccountName and is unique to Active Directory. Each user and group in AD will have this attribute (this is required). While in eDirectory no one will get it, unless they strangely extend the eDirectory schema to add it.

There is probably something in RootDSE that will indicate which one is the source directory. But I'm not sure about a great example.

0
source

All Articles