Using SMB compression under Windows Server 2022 and Windows 11
To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!
Bonjour,
Use SMB compression in Windows Server 2022 and Windows 11 to reduce data transfer times on network shares.
Commands used in the SMB compression demonstration video
Microsoft documentation : https://docs.microsoft.com/en-us/windows-server/storage/file-server/smb-compression
$source = 'C:\compression_smb'$share = '\\server\share_name'
# Create a 10 GB virtual disk for the demo# Requires the hyper-v moduleNew-VHD $source\smb_demo.vhdx -Fixed -SizeBytes 10gb
# Use Robocopy.exe without SMB compressionROBOCOPY $source $share *.vhdx
# Use Robocopy.exe to request SMB compression with /COMPRESSROBOCOPY $source $share *.vhdx /COMPRESS
# Create a share that always requires SMB compressionNew-SmbShare -Name share -Path d:\share -CompressData $true
# Enable the default SMB compression request for an existing shareSet-SmbShare -Name share -CompressData $true
# Request SMB compression on mapped drives# New-SMBMapping with -CompressNetworkTraffic $true.New-SmbMapping -LocalPath Z: -RemotePath $share -CompressNetworkTraffic $true
# Map a drive using NET USE /REQUESTCOMPRESSION:YES.NET USE * $share /REQUESTCOMPRESSION:YES
# Use Robocopy.exe to request SMB compression using /COMPRESSROBOCOPY $source $share *.vhdx /COMPRESS
# Use Xcopy.exe to request SMB compression with /COMPRESSXCOPY $source\*.vhdx $share\* /COMPRESS# Always compress (SMB client)Set-ItemProperty -Path HKLM:\System\CurrentControlSet\ServicesLanmanWorkstation\Parameters `-name EnableCompressedTraffic -value 1# No restart is required.
# Ignore all compression requests (SMB client)Set-SMbClientConfiguration -DisableCompression $true# orSet-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\LanmanWorkstation\Parameters ` -name DisableCompression -value $true # or-name DisableCompression -value 1# No restart is required.
# Ignore all compression requests (SMB server)Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\LanmanServer\Parameters `-name DisableCompression -value 1# No restart is necessary.
# Always compress whatever the file size (Tries to compress the 4 1st GB of the file, if 1 byte is compressible, compresses the rest of the file).Set-ItemProperty -Path HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters `-name CompressibilitySamplingSize -value 4294967295Set-ItemProperty -Path HKLM\System\CurrentControlSet\ServicesLanmanWorkstationParameters `-name CompressibleThreshold -value 0
Video : Using SMB compression under Windows Server 2022 and Windows 11
Related links
How to add and change languages in Windows 10 and Windows 11
How to add and change languages in Windows 10 and Windows 11Services and the services console on Windows
A video presenting services and the Windows services console (start-up mode, service properties and user services)The difference between a printer and a printing device
The difference between a printer and a printing deviceWindows - ms-settings shortcuts in the Settings menu
The arrival of Windows 10 and its new Settings menu brings us the ability to use ms-settings shortcuts that allow us to directly access specific locations in SettingsWindows Defender attack surface reduction and exploit protection features
Windows Defender attack surface reduction and exploit protection featuresThe hidden Network Protection feature in Windows defender
The hidden Network Protection feature in Windows defender
Follow me on
Support me
Last content
Powershell - Testing network connectivity and port accessibility
Powershell - Display network connections (equivalent to netstat)
Powershell - Testing name resolution (equivalent to nslookup)
Powershell - View and manage DNS configuration of network interfaces
Powershell - Managing IP configuration of network interfaces
Powershell - Managing the status and configuration of network interfaces
Powershell and the Left Hand Side
Powershell - Managing disks, partitions and volumes