Learn how to configure Windows Server 2022 SMB compression

Administrators under pressure to make the most of their available resources can put pressure on files to free up network bandwidth with a new Windows Server feature.

As part of its improvements to new server operating system storage features, Microsoft has developed Windows Server 2022 SMB compression to shrink files when transferring to or from a network file share. This compression not only reduces bandwidth requirements, but also speeds up file transfers because less data moves across the network.

System Requirements and Prerequisites for Windows Server 2022 SMB Compression

SMB compression on a file server requires Windows Server 2022. Additionally, customers must be running Windows 11. Administrators cannot use Server Manager to configure SMB compression and will need to deploy the feature with Windows Admin Center or PowerShell.

Use Windows Admin Center to configure Windows Server 2022 SMB compression

To configure Windows Server 2022 SMB compression, open Windows Admin Center and connect to the file server. Then select the Files and file sharing tab, shown in Figure 1.

Figure 1. Select the Files and File Sharing tab in Windows Admin Center to start the SMB compression setup process.

Select the File shares tab near the top of the interface. This tab lists all file shares that are on the server. If you want to enable SMB compression on an existing file share, click that share. Otherwise, click the New share button, shown in Figure 2, to create a new file share.

Create a file share
Figure 2. Click the New Share button in Windows Admin Center to create a new file share.

To create a new file share, select a folder to share, then give the share a name.

Click on the share to modify and Share permissions shutter will open. Scroll down the pane and check the Compress data as shown in Figure 3. Click on the option Edit to finish configuring SMB compression on the file share.

SMB compression settings
Figure 3. Check the Compress data box and click the Edit button to enable SMB compression on the file share.

How to use PowerShell to set Windows Server 2022 SMB compression

For administrators who prefer to use PowerShell, you can use the automation tool to enable or disable SMB compression for a Windows Server 2022 file share. For example, to disable SMB compression for a share named Files use the following command:

Set-SMBShare -Name "Files" -CompressData $False

To adjust this setting and enable SMB compression for the same share, use the following PowerShell command:

Set-SMBShare -Name "Files" -CompressData $True

Customer Considerations When Using SMB Compression

To use SMB compression, the Windows 11 client must make a request. You can configure it in two ways.

The first option is to create a registry value telling the client to always request compression. As always, be careful when editing the registry to avoid problems.

To get started, open the registry editor on the client and navigate to the HKEY_LOCAL_MACHINESystemCurrentControlSetServicesLanmanWorkstationParameters location. Create a new REG_DWORD called value Enable Compressed Traffic and assign it the value 1.

The other option is to disconnect and then remap the client’s network drives. If you are mapping the drive via PowerShell, you can use the New-SMBMapping cmdlet with cmdlet Compress network traffic setting. For example, to map drive X: to a share named Files on a named server FileServer.PoseyLab.com then you would run the following command:

New-SMBMapping -LocalPath "X:" -RemotePath FileServer.PoseyLab.comFiles -CompressNetworkTraffic $True

Some organizations may use older DOS batch-like commands in logon scripts for network drive mapping. In these cases, you can use the net use command with the required parameter, such as the following command:

net use X: FileServer.PoseyLab.comFiles /REQUESTCOMPRESSION:YES

How to Monitor File Compression in Windows Server 2022

To see how long it takes to transfer a large file over the network with SMB compression enabled, you check the results through Windows Performance Monitor (perfmon).

From the Windows 11 client, run performance and navigate to the SMB Server Shares performance object, then add the Compressed queries/sec counter and the Compressed responses/sec counters.

You can run tests with and without SMB compression to see the difference between how many times per second the Windows 11 client requests compressed data and how often the Windows Server 2022 file share grants those requests.

Incompatible clients will not experience the benefits of SMB compression

Windows Server 2022’s SMB compression feature can help an organization that manages on-premises file servers stay unaffected by the network when Windows 11 users move large files. SMB compression will not make files in the file share inaccessible to other clients, such as Windows 10 or Linux, but they will not be able to experience the performance benefits of Windows 11 machines.

Comments are closed.