Hi
If you do not want to retrieve the environment information, you could try
to create the ADSystemInfo object... if you get a DN for the computername
or the username, then you are on the AD, if not, it could be NT 4.
Getting the Host Domain Name
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_
exch2k_getting_the_host_domain_name.asp
If you are on the AD, you then bind to the RootDSE object an look at the
domainFunctionality attribute.
This will tell you what mode the AD is running in, see the following link
for details:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/ad
schema/rootdse.asp?frame=true
If this fails, then you are most likely on an NT 4 domain. Their is no
quick way to determine which domain you are part of with ADSI. The above
method requires you to wait to the LDAP timeouts....
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.