Windows Server 2016 – SMB share with PowerShell

You can create an SMB share using PowerShell by simply writing :

new-smbshare -name backups -path c:\backups -fullaccess everyone

, <span>Windows Server 2016 –  SMB share with PowerShell</span>, KandZ

, <span>Windows Server 2016 –  SMB share with PowerShell</span>, KandZ

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

Get-SmbShare

, <span>Windows Server 2016 –  SMB share with PowerShell</span>, KandZ

remove-smbshare -name backups # to remove the share "backups"

, <span>Windows Server 2016 –  SMB share with PowerShell</span>, KandZ

 

26640cookie-checkWindows Server 2016 – SMB share with PowerShellWindows Server 2016 – SMB share with PowerShell

Related posts

Leave a Comment