Hi,
I want to obtain the name of the domain associated with the computer in the
way it is displayed by the My Computer's Properties dialog.
I've been using the native NetWkstaGetInfo method but it does not return the
full name of the domain.
Ex.
Properties dialog display: Domain: webfactory.ecom-webfactory.de
NetWkstaGetInfo returns: webfactory
Any idea how to get the complete domain name?
Thanks,
Mircea
Phil Wilson - 23 Nov 2005 19:26 GMT
Environment.UserDomainName?

Signature
Phil Wilson
[Microsoft MVP-Windows Installer]
> Hi,
>
[quoted text clipped - 14 lines]
> Thanks,
> Mircea
"Jeffrey Tan[MSFT]" - 24 Nov 2005 11:55 GMT
Hi Mircea,
Thanks for your post.
To get the fullname of the domain, you can use get the USERDNSDOMAIN
environment variable. Code listed below:
MessageBox.Show(Environment.GetEnvironmentVariable("USERDNSDOMAIN"));
Hope it helps
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.