-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpvs_server_Optimize.ps1
More file actions
34 lines (33 loc) · 1.51 KB
/
pvs_server_Optimize.ps1
File metadata and controls
34 lines (33 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Function RegWrite ($regPath, $regName, $regValue, $regType)
{
If (!(Test-Path $regPath))
{
New-Item -Path $regPath -force
}
New-ItemProperty $RegPath -Name $regName -Value $regValue -PropertyType $regType -force
}
#—————————-
# Disable offloads globally
#—————————-
RegWrite "HKLM:\System\CurrentControlSet\Services\TCPIP\Parameters\DisableTaskOffload" 1 DWord
#—————————-
# Disable all IPv6 in registry
#—————————-
RegWrite "HKLM:\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters" "DisabledComponents" 0x000000FF Dword
#—————————-
# Disable all offloads for VMXNET3 adapters
#—————————-
Get-ChildItem ‘HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}’ -rec -ea SilentlyContinue | foreach {
$CurrentKey = (Get-ItemProperty -Path $_.PsPath)
If ($CurrentKey -match "vmxnet3 Ethernet Adapter")
{
$StrKeyPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\" + $CurrentKey.PSPath.Substring($CurrentKey.PSPath.Length – 4, 4)
RegWrite $StrKeyPath "*IPChecksumOffloadIPv4" 0 String
RegWrite $StrKeyPath "*TCPChecksumOffloadIPv4" 0 String
RegWrite $StrKeyPath "*UDPChecksumOffloadIPv4" 0 String
RegWrite $StrKeyPath "*LsoV1IPv4" 0 String
RegWrite $StrKeyPath "*LsoV2IPv4" 0 String
RegWrite $StrKeyPath "OffloadIPOptions" 0 String
RegWrite $StrKeyPath "OffloadTcpOptions" 0 String
}
}