Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Return FQDN of machine

Posted on 2006-07-17
5
Medium Priority
?
1,620 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 800 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 1200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 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