Open jeremy-jameson opened 6 years ago
The error occurs when the account specified by the HostUsername variable in the configuration file does not have administrator permission on the Hyper-V host servers.
To resolve the error, add the HostUsername account to the Administrators group on each Hyper-V server:
$hyperVHosts = @("TT-HV05A", "TT-HV05B", "TT-HV05C")
$domain = "TECHTOOLBOX"
$username = "s-nc01-host"
$script = "
([ADSI]'WinNT://./Administrators,group').Add(
'WinNT://$domain/$username,user')
"
$scriptBlock = [ScriptBlock]::Create($script)
$hyperVHosts |
foreach {
$computer = $_
Invoke-Command -ComputerName $computer -ScriptBlock $scriptBlock
}
Command line:
.\SDNExpress.ps1 -ConfigurationDataFile .\FabricConfig.TECHTOOLBOX.psd1 -Verbose
Output