Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2005

Tip: Looking for answers? Try searching our database.

Obtain computer's domain name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mircea Pleteriu - 23 Nov 2005 11:45 GMT
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.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.