Equivalent of Linux command `hostname --fqdn` in Windows XP?

Please Visit: http://ift.tt/1ajReyV



Equivalent of Linux command `hostname --fqdn` in Windows to get full hostname

http://ift.tt/Ku1W0p

echo %COMPUTERNAME%.%USERDNSDOMAIN%

Or you can grep (under Windows: find /I "string") for Host- and Domain from set or systeminfo or ipconfig -all name and glue it together elsewhere.

The variable %USERDNSDOMAIN% is only available when logged on to a domain... The DNS suffix you get from a DHCP server is not put into a environment variable



In Powershell:

To get FQDN of local computer:



[System.Net.Dns]::GetHostByName(($env:computerName)).HostName

To get FQDN of Remote computer:

[System.Net.Dns]::GetHostByName("mytestpc1").HostName



from Google Plus RSS Feed for 101157854606139706613 http://ift.tt/Ku1W0p

via LifeLong Community

No comments:

Post a Comment