Post by Jurgen PostelmansdnsHostName returns the full name of the server(like servername.domain.com).
What I'm looking for is domain.com.
I'm unsure whether I can just extract the domain name from the dnsHostName?
Is the servername always before the first dot? Isn't there a property in AD
that gives me immediatly the qualified domain name?
Yes, you can easily get that info from the IADsADSystemInfo interface.
C# sample follows - you need to have a reference to the COM "Active DS
Type Library" and a "using ActiveDs" statement in your C# file for
this to work:
// get a IADsADSystemInfo object and show it
IADsADSystemInfo oSysInfo = new ADSystemInfoClass();
Console.WriteLine(oSysInfo.DomainDNSName);
oSysInfo will contain a number of other interesting fields, too.
HTH
Marc
________________________________________________________________
Marc Scheuner ** mscheuner -at- mvps.org ** http://adsi.mvps.org
Microsoft MVP for Directory Services Programming
http://www.dirteam.com/blogs/mscheuner/default.aspx
Come see http://groups.yahoo.com/group/ADSIANDDirectoryServices/