What version of SMB are my clients connecting to my Windows server with?

In light of the recent WannaCry attack, this simple PowerShell one liner will give you some insight into what SMB version your clients are connect to your Windows servers with. This works with any server that is running 2012 and up. This gives the current SMB connections for all 2012 servers in your Active Directory domain.

Invoke-Command -ComputerName (Get-ADComputer -Filter 'operatingsystem -like "*Server 2012*"' -Properties * | Select -ExpandProperty Name) -ScriptBlock {Get-SmbSession | Select *} | Select-Object PSComputername,Dialect,ClientComputerName,Clientusername

PSComputerName Dialect ClientComputerName ClientUserName
-------------- ------- ------------------ --------------
Server         3.02      DOMAIN\Test$

Comments are closed.