Showing posts with label FQDN. Show all posts
Showing posts with label FQDN. Show all posts

Thursday, May 22, 2014

Powershell: Get FQDN of local or remote computer

To get FQDN of local computer:

PS C:\> [System.Net.Dns]::GetHostByName(($env:computerName))

To get FQDN of Remote computer:

PS C:\> [System.Net.Dns]::GetHostByName("notebook01")

Note: 
System.Net.DNS class has a few other useful methods using which you can get FDQN and IP address details.

Refer to http://msdn.microsoft.com/en-us/library/system.net.dns.aspx for more details.

PS C:\> [System.Net.Dns] | Get-Member -Static