How to check which SMB Version is enabled on Windows Server 2008 R2

How to check which SMB Version is enabled on Windows Server 2008 R2

I am using Windows Server 2008 R2. I want to know which version of SMB is enabled on my server.

I used the following command in PowerShell to know the smb versions installed: sc.exe qc lanmanworkstation

In its output, the DEPENDENCIES shows two versions of SMB : MRxSmb10 and MRxSmb20.

Now the confusion is out of 2 versions installed, which SMB version is enabled on my server? As windows server 2008 R2 does not support get-smbconnection command, I am unable to determine the specific version.

I also checked the registry path HKEY_LOCAL_MACHINE\\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and there is no entry about SMB version.

Can anyone please tell me how to determine which SMB version is enabled on server if SMB versions are more than one?

решение1

If you don't see HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters containing key for SMB1 with REG_DWORD: 0 for disabled, then it is enabled, which adds up with the other method that indicated the lanmanworkstation having dependency for both MRxSmb10 and RxSmb20.

As described in How to detect, enable and disable SMBv1, SMBv2, and SMBv3 section for Windows Server 2008 R2, you can disable SMBv1 with

sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi
sc.exe config mrxsmb10 start= disabled

After that, sc.exe query lanmanworkstation should only show MRxSmb20.

решение2

echo Verification de l'etat des protocoles SMB : echo --------------------------------------- echo. for %%V in (1 2) do ( for /F %%L in ('sc qc lanmanworkstation ^| find "mrxsmb%%V0"') do ( echo - Le gestionnaire reseau depend du protocole SMB V%%V for /F %%S in ('sc query mrxsmb%%V0 ^| find /C "RUNNING"') do ( IF %%S EQU 1 ( echo OK, le service SMB V%%V est en cour d'execution, poursuite de l'execution du script ) else ( echo. echo ******************************************************************************************************** echo SMB V%%V n'est pas en cours d'execution, arret du script echo Dans une console administrateur, taper les commandes ci-dessous puis redémarrer le poste si nécessaire : echo. echo C:^> sc qc lanmanworkstation ^(pour visualiser les dependances, mrxsmb10 = SMB V1, mrxsmb20 = SMB V2^) echo C:^> sc config lanmanworkstation depend= bowser/mrxsmb20/nsi ^(Pour exclure la dependance du protocole SMB V1^) echo C:^> sc config mrxsmb10 start= disabled ^(Pour désactiver SMB V1^) echo C:^> sc config mrxsmb20 start= auto ^(Pour lancer automatiquement SMB V2^) echo C:^> net stop workstation /YES ^(Pour redémarrer le service^) echo C:^> net start workstation echo ******************************************************************************************************** goto END_SCRIPT ) ) ) )

Связанный контент