You can create an SMB share using PowerShell by simply writing :
new-smbshare -name backups -path c:\backups -fullaccess everyone
You can also use –readaccess or –changeaccess instead of fullaccess
There are more parameters you use like:
- EncryptData (True or False) encrypts the files in the share folder
- FolderEnumerationMode (AccessBased or Unrestricted) Default is Unrestricted
- Temporary the share persists until next computer restart.
- ConcurrentUseLimit the maximum number of users for simultaneously connection. 0 for unlimited users
for more information read here
remove-smbshare -name backups # to remove the share "backups"
266400cookie-checkWindows Server 2016 – SMB share with PowerShellWindows Server 2016 – SMB share with PowerShell