SyntaxFix
Write A Post
Hire A Developer
Questions
I use the following syntax :
$Domain=[System.Net.Dns]::GetHostByName($VM).Hostname.split('.') $Domain=$Domain[1]+'.'+$Domain[2]
it does not matter if the $VM is up or down...