Solved

Return FQDN of machine

Posted on 2006-07-17
5
1,612 Views
Last Modified: 2012-06-27
Hi all,

I am hoping to return the FQDN of the computer running this win app.

Environment.MachineName just doesn't cut it :)

Anyone got a solution?

Bryan
0
Comment
Question by:bryanford
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 41

Expert Comment

by:graye
ID: 17131991
Hummm.... so what were you expecting as an answer?

Something like:   CN=MACHINE12,CN=Workstations,DN=SomeDomain,DN=Com

or just:        Machine12.SomeDomain.Com

I'd recommend an LDAP query against the domain to get either answer
0
 
LVL 1

Author Comment

by:bryanford
ID: 17134696
I dont think an LDAP query would do the job because of what happens. This app will be run on a few different machines on different forests and i dont want to hard code any domain settings anywhere.

I am just after something like Machine12.somedomain.com

The environment.machinename only gives you Machine12
0
 
LVL 41

Assisted Solution

by:graye
graye earned 200 total points
ID: 17137768
If you're using VB.Net 2005, then you can use the new IPGlobalProperties class

Imports System.Net.NetworkInformation
Debug.writeline(IPGlobalProperties.GetIPGlobalProperties.HostName & "." & IPGlobalProperties.GetIPGlobalProperties.DomainName)
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 300 total points
ID: 17140416
Try this:

   Dim fqdn As String = System.Net.Dns.GetHostByName("LocalHost").HostName

Bob
0
 
LVL 1

Author Comment

by:bryanford
ID: 17142325
Thanks guys,

Both return what I am after however the shortest code wins the majority of points :)

Thanks for that

Bryan
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question