well, yesterday I was stumbling over an interesting issue. I used the cmdlet "test-connection" and expected either to get the FQDN (Full Qualified Domain Name) automatically or be able to use some sort of switch in order to get the FQDN. Apparently there is no switch and I must admit I never needed test-connection providing the FQDN.
so that's my solution I came up with and it works pretty well:
$ComputerName = 'MyComputer'
test-connection ([System.Net.Dns]::GetHostByName($ComputerName)).Hostname
If someone has a shorter/quicker/better solution leave a comment
No comments:
Post a Comment