среда, 12 октября 2022 г.

hyper-v manager standalone server

#on server
#Enable-PSRemoting
#Enable-WSManCredSSP -Role server

$ethint="Ethernet"
$hvservername="r-hv1"
$hvserverip="192.168.126.50"

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Tools-All -All
Set-NetConnectionProfile -InterfaceAlias $ethint -NetworkCategory Private
Add-Content -Path C:\Windows\System32\drivers\etc\hosts -Value "`n"$hvserverip"`t"$hvservername
winrm quickconfig
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $hvservername
Enable-WSManCredSSP -Role client -DelegateComputer $hvservername
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\" -Name 'CredentialsDelegation'
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\" -Name 'AllowFreshCredentialsWhenNTLMOnly' -PropertyType DWord -Value "00000001"
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\" -Name 'ConcatenateDefaults_AllowFreshNTLMOnly' -PropertyType DWord -Value "00000001"
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\" -Name 'AllowFreshCredentialsWhenNTLMOnly'
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\AllowFreshCredentialsWhenNTLMOnly\" -Name '1' -Value "wsman/$hvservername"

Ратнер Арсений, arsenyratner@gmail.com, 7 985 273 2090