Is that share using SMBv1?

Sharing is caring, unless the share is using SMBv1.

In case you’ve missed it (though, if you’re a data professional or other IT pro, you must live under a rock if you’ve missed it), SMBv1 should never ever be used. Alas, some shares out there still exist & use it.

Recent Windows updates have tried to turn off SMBv1 , alas Microsoft’s Ned Pyle (twitter|blog) still maintains a long list of products that still need SMBv1.

As a DBA, you probably don’t spend too much time managing file shares, or worrying about SMB versions, but you should be asking yourself:

Does my backup target use SMBv1?

You might tell yourself that the easiest way to figure this out is to ask your friendly neighborhood storage admin, “Hey, Sam…. Does my backup share use SMBv1?” and Sam will say, “Heck no!” and you’ll be on your way. But…Do you trust Storage Sam? Does Sam actually know, or is he guessing? Maybe your backups live on a separate device, and Storage Sam forget that your backup share is a special snowflake. Or maybe you’re just a typical untrusting DBA, and even though Storage Sam was a Boy Scout, you want to trust, but verify.

PowerShell all the things

I’ve learned that if I want to check some server configuration, there’s usually a PowerShell command that can make it easy. This is particularly true when I start to think about checking some server configuration on a remote server or list of remote servers. Sure enough, a quick Google, and I was in businesses.

Step 1) Connect to the share

In order to make this work, I’ll need to connect to the file share(s) that I want to know about their SMB version. I could just open a Windows Explorer window and browse to that folder, I could map a drive, or any number of ways. Heck, maybe I’m already using it. Since I’ve already got my PowerShell prompt open, I decided I’d map a drive in PowerShell using New-PSDrive, just to be sure.

PS C:\> $drive = New-PSDrive -Name DB-Backups -PSProvider FileSystem -Root \\\DB-Backups

If I had multiple shares I wanted to check, I could just repeat the above line, with a unique name for each share path.

Step 2) Get the SMB connection info

Next, if I want to get info about the SMB connection(s), I use the Get-SmbConnection (funny how obvious that turns out being). Nothing fancy here. No parameters, no magic, just the command:

PS C:\> Get-SmbConnection

Like magic, the returned object will show the Dialect of each share. In this case, the device I am connecting to is using SMB 2.1:

If anything is using SMBv1, you should raise some hell with Storage Sam. Tell him to listen to Ned, and stop using SMB1. Remind Storage Sam how many problems have been caused by SMB1, and urge him to learn from everyone else’s mistakes.


1 Trackback / Pingback

  1. Is That Share SMB1? – Curated SQL

Comments are closed.