There are several protocols to perform specific tasks in Windows Server and one of them is the SMB protocol (Server Message Block - Server Message Block Protocol) which is focused on one of the most popular tasks such as file transfer. The protocol dates back more than 20 years since the SMB1 version was developed, and today we have the SMB3 version, which significantly improves the security and reliability of the information..
The SMB protocol is a file sharing protocol called in other terms Microsoft's SMB protocol, it is made up of a group of message packets which defines the version of the protocol or the protocol of the common Internet file system (CIFS).
SMB Features
Some of the main functions of SMB are:
- Managing Microsoft SMB protocol servers on the network or local network browsing
- Extended handling of file attributes
- Allows you to perform printing tasks on the local network
- File and directory change notification for added control
SMB packages
The SMB protocol handles various types of packets such as:
- Session control packets: your task is to grant a connection to the server shares
- File access packages: its role is to access and work on the files and directories on the remote server
- General message packages: its action is to send data to print queues, mailing lists and generate data on the status of print queues.
SMB functions
SMB1 has been classified as a security threat for Windows systems in general and that is why SMB2 offers us:
- Support for symbolic links
- Oplock customer lease model
- Support for older versions of SMB
- More extensive reads and writes for task optimization
- Better utilization of the network
- Improved scalability for file sharing
With this in mind we are going to see how to activate both SMB1 and SMB2 in Windows Server 2022..
To stay up to date, remember to subscribe to our YouTube channel! SUBSCRIBE
1. Activate SMB1 in Windows Server 2022 from Control Panel
Step 1
We are going to:
- Programs and characteristics
Step 2
We click on "Enable or disable Windows features" and this redirects us to the Server Manager, there we will see the following:
Step 3
Click Next and activate the "Role-based or feature-based installation" box:
Step 4
In the next window we select the server:
Step 5
In the next window we will see the role options for Windows Server 2022:
Step 6
In this case we do not add any role, we go to the "Features" section and activate the box "Compatibility with the protocol for sharing SMB 1.0 / CIFS files", we display its options and activate the desired boxes "SMB Client 1.0 / CIFS / SMB Server 1.0 / CIFS ":
Step 7
Click Next to see a summary of the feature to install:
Step 8
Click Install to start the process:
Step 9
At the end of this task we will see the following:
Step 10
Restart Windows Server 2022 to complete the process as it is necessary:
2 . Activate SMB1 in Windows Server 2022 from PowerShell
Step 1
We open PowerShell as administrator:
Step 2
First, we are going to detect the SMB1 protocol with the command:
Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Step 3
There we see specific details of the protocol, we enable SMB1 in Windows Server 2022 with the command:
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Step 4
This will load all the necessary plugins and at the end we will see the following:
3 . Activate SMB2 on Windows Server 2022 from PowerShell
Step 1
To activate this protocol in Windows Server 2022 we are going to open PowerShell as administrator:
Step 2
We are going to detect the SMB2 protocol with the command:
Get-SmbServerConfiguration | select EnableSMB2Protocol
Step 3
Now enabled by SMB2. We enter the letter S to confirm the process.
Set-SmbServerConfiguration –EnableSMB2Protocol $ true
Step 4
In this same PowerShell console we are going to detect the SMB1 server:
Get-Item HKLM: \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Parameters | ForEach-Object {Get-ItemProperty $ _. Pspath}
Step 5
This command gives us complete details about the SMB1 server, to enable it from here, the SMB1 server, we execute:
Set-ItemProperty -Path "HKLM: \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Parameters" SMB1 -Type DWORD -Value 1
Step 6
In the same way we are going to detect the SMB2 server:
Get-ItemProperty HKLM: \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Parameters | ForEach-Object {Get-ItemProperty $ _. Pspath}
Step 7
To enable the SMB2 server we execute:
Set-ItemProperty -Path "HKLM: \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Parameters" SMB2 -Type DWORD -Value 1
4. Enable SMB1 and SMB2 in Windows Server 2022 from Registry Editor
Step 1
Before executing this process it is advisable to create a restore point or backup, after this we access the registry editor:
Step 2
Now we go to the path "HKEY_LOCAL_MACHINE - SYSTEM - CurrentControlSet - Services - LanmanServer - Parameters":
Step 3
There we find the SMB1 and SMB2 values, to enable them, we double click on each one and enter 1 in the Value information field so that its status becomes enabled. Apply the changes.
5. Activate SMB1 and SMB2 in Windows Server 2022 from CMD
Step 1
Another of the available methods is the command prompt console, we access CMD:
Step 2
, To detect SMB1 we execute:
sc.exe query lanmanworkstation
Step 3
We enable SMB1 with the following command:
sc.exe config lanmanworkstation depend = bowser / mrxsmb10 / mrxsmb20 / nsi
Step 4
To detect SMB2 we execute:
sc.exe query lanmanworkstation
Step 5
To enable SMB2 we use the command:
sc.exe config lanmanworkstation depend = bowser / mrxsmb10 / mrxsmb20 / nsi
6 . Activate SMB1 and SMB2 in Windows Server 2022 from PowerShell
Step 1
Finally we can resort again to PowerShell, we open PowerShell as administrators and to activate SMB1 we execute:
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Step 2
At the end we will see the following. There we enter the letter Y to restart the computer or N to do it later.
Step 3
Now we activate SMB2 with the command. With the letter S we confirm the process.
Set-SmbServerConfiguration -EnableSMB2Protocol $ true
These are the methods that TechnoWikis gives you to activate SMB1 and SMB2 in Windows Server 2022.