SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
SQL Server - Powershell - Get FQDN – Hostname and IP address

22 January,2013 by Jack Vamvas

Question: How can I obtain the Fully Qualified Domain Name (FQDN) of the local and remote servers  using Powershell? 

how can I obtain the IP address of the server?

Answer: In powershell there are a number of different methods. The most effective  is using the System.Net.Dns class.  These examples illustrate the ease of use to obtain FQDN and IP address for local and remote servers.

 

#Get the FQDN of the local server
"$env:computername.$env:userdnsdomain"

#Get the FQDN of the local server
[System.Net.Dns]::GetHostByName(($env:computerName))

#Get the FQDN of the IP address  for remote server
[System.Net.Dns]::GetHostByName("server1")
[System.Net.Dns]::GetHostByName("server2")

#Get the IP address of the FQDN
[System.Net.Dns]::GetHostAddresses("server3")

 Read More

Powershell List all Patches Updates on a Server - SQL Server DBA

How to check Operating System type with Powershell - SQL Server ...

Powershell sql server security audit - SQL Server DBA


Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer