Open bill-long opened 11 months ago
I'm not sure how to determine the FQDN of the local machine if the short name does not resolve. For example, this StackOverflow answer says that [System.Net.Dns]::GetHostByName($env:computerName)
is the correct way to get the FQDN of the local machine, but that relies on DNS. If DNS can resolve the short name to the correct FQDN, we won't hit this issue in the first place.
The script attempts to Import-PSSession as follows:
$Server is the short name of the server, and this error is the result when the short name does not resolve. Changing it to the FQDN fixes it, as long as the FQDN does resolve.
Need to evaluate whether we should change the script to use FQDN instead of short name.