New-ItemProperty `
-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" `
-Name "LocalAccountTokenFilterPolicy" `
-Value 1 `
-PropertyType DWord `
-Force
Set-NetConnectionProfile -InterfaceIndex 17 -NetworkCategory Private
New-NetFirewallRule `
-DisplayName "Allow WinRM 5985 From 192.168.1.0-24" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 5985 `
-RemoteAddress 192.168.173.0/24 `
-Action Allow `
-Profile Any
New-NetFirewallRule `
-DisplayName "Allow Agent 19100 From 192.168.1.0-24" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 19100 `
-RemoteAddress 192.168.1.0/24 `
-Action Allow `
-Profile Any
Enable-PSRemoting -Force
Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true
Set-Item -Path WSMan:\localhost\Service\Auth\Negotiate -Value $true
Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $true
Restart-Service WinRM
评论 (0)