Question:
What could be the best way to resolve a computer name apart from using:
1 2 |
[System.Net.DNS]::GetHostByName('MachineName').HostName |
I dont want to import any specific DNS Modules.
Answer:
You can try the GetHostEntry method:
1 2 |
[Net.DNS]::GetHostEntry("MachineName") |
Another way would be to ping it using Test-Connection
cmdlet, see this tip