I am creating Shared folder and want to set permissions on it with SharePoint farm account and App_Pool Account as below:

$FullAccessAccounts = "domain\farm,domain\app_pool"
$ReadAccount = "domain\account3"

 New-Item $folderpath –type directory
    New-SMBShare –Name "MyFolder" –Path $folderpath –ContinuouslyAvailable $true –FullAccess $FullAccessAccounts -ReadAccess $ReadAccount

But i am getting following error, which i could not understand how to solve this?

New-SMBShare : No mapping between account names and security IDs was done.

3 Answers 3


The documentation for the command is very poor concerning the required format for the IDs. If you modify your example and change the line:
$FullAccessAccounts = "domain\farm,domain\app_pool"
$FullAccessAccounts = ("farm","app_pool")
this will work:
New-SMBShare –Name "MyFolder" –Path $folderpath –FullAccess $FullAccessAccounts

Note that you have to omit the domain name.


I found another similar issue. The group I was try to use with Grant-SmbShareAccess had been renamed in the past. if I changed the variable to use the Group Name (pre-Windows 2000): value it worked. we are part of an enterprise domain that has been running since 4.0 days.

  • I can't tell if this is commentary or an answer. If this is an answer, can you update it so that it's a bit more clear?
    – wjervis
    Dec 2, 2016 at 18:32

Also check the accounts being assigned actually exist in the Active Directory, and there are no duplicate entries.

I found this PowerShell useful:

$ReadAccessUserList = $ReadAccessUserList | Sort-Object | Select-Object -Unique

Easy then to loop through, display the user list about to be implemented, remove any domain references if necessary, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.