22 January,2013 by Tom Collins
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")
To get FQDN of multiple servers - How to get FQDN of multiple servers with Powershell
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
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |