########################################
########################################
$iphvserver="x.x.x.x"#############
$namehvserver="hv-srv"#############
########################################
########################################
########################################
$iphvserver="x.x.x.x"#############
$namehvserver="hv-srv"#############
########################################
########################################
#on server
###############################
###############################
Enable-PSRemoting
Enable-PSRemoting -SkipNetworkProfileCheck -Force
Enable-WSManCredSSP -Role Server
Set-NetFirewallRule -Name "WinRM-HTTP-In-TCP-Public" -RemoteAddress Any
Enable-PSRemoting -SkipNetworkProfileCheck -Force
Enable-WSManCredSSP -Role Server
Set-NetFirewallRule -Name "WinRM-HTTP-In-TCP-Public" -RemoteAddress Any
#on client
###############################
###############################
Add-Content C:\Windows\System32\drivers\etc\hosts "$iphvserver $namehvserver"
# Install only the PowerShell module
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell
# Install the Hyper-V management tool pack (Hyper-V Manager and the Hyper-V PowerShell module)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Tools-All
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Tools-All
Test-NetConnection -ComputerName $namehvserver -Port 5985
Enable-PSRemoting
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $namehvserver
Enable-WSManCredSSP -Role client -DelegateComputer $namehvserver
Enable-PSRemoting
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $namehvserver
Enable-WSManCredSSP -Role client -DelegateComputer $namehvserver
#Local Policy
gpedit.msc -->
#Computer Configuration > Administrative Template > System > Credentials Delegation
#Allow delegating fresh credentials with NTLM-only server authentication,
#add wsman/$namehvserver.
gpedit.msc -->
#Computer Configuration > Administrative Template > System > Credentials Delegation
#Allow delegating fresh credentials with NTLM-only server authentication,
#add wsman/$namehvserver.
##add remote server in Hyper-V Manager