Creating and securing SMB shares
For generations, administrators have used the net.exe
command to set up shared folders and a lot more. These continue to work but you may find the new cmdlets easier to use, particularly if you are automating large-scale SMB server deployments.
This recipe looks at creating and securing shares on a Server 2016 platform using the PowerShell SMBServer
module.
Getting ready
For this recipe, you use the file server (FS1
) that you hardened in the recipe Securing your SMB server. On this server, you share out folders on the file server. Later, in the recipe Accessing SMB shares, you access the shared folders. Ensure you have created the C:\Foo
folder on FS1
. This recipe uses a security group, IT Management
which you create in the Reskit.Org
AD (or use a different group).
How to do it...
- Discover the existing shares and access rights:
Get-SmbShare -Name * | Get-SmbShareAccess | Sort-Object -Property Name | Format-Table -GroupBy Name
- Share a folder...