Error while setting up a new smb share using powershell


I’m working on writing a PowerShell script that will setup a folder structure on the c drive and then turn those folders into shares.

When using the New-SmbShare cmdlet I’m getting a 1332 or a 50 error.

With the Domain I get a 1332 Error

New-SmbShare -Name "InstallerFiles" -Path "C:\SoftwareDistribution\InstallerFiles" -ContinuouslyAvailable $true -ReadAccess "domain\Authenticated Users"

If I remove the domain I get the 50 Error.

New-SmbShare -Name "InstallerFiles" -Path "C:\SoftwareDistribution\InstallerFiles" -ContinuouslyAvailable $true -ReadAccess "Authenticated Users"

I’m able to create the Share if I remove -ContinuouslyAvailable and -ReadAccess, but I want to be able to assign the users or security groups permissions from the script.

What do I need to change in order to setup an smb share and assign users or security groups using PowerShell?


You need to remove the -ContinuouslyAvailable flag. As far as I know, this flag is set to True by default anyway.

You may also want to take a look at these:

As the function may not be available in your environment, hence the New-SmbShare : The request is not supported. Error

and your first error: No mapping between account names and security IDs was done, i believe this basically means “user not found” see here:

and maybe try the example from here:


Error while setting up a new smb share using powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply