How to Create SMB Share as Non-Admin on Windows Server 2016

network-sharewindows-server-2016

Windows Server 2016, Octopus Deploy.

Is it possible to create network shares as a non-admin?

I'm trying to run an automated deployment under a non-admin account. The last step of the deployment is to create a network share so that end-users are able to access some of the deployed files.

But New-SmbShare -Name $shareName -Path $path -ReadAcces $domainusergroup fails with a Permission Denied (5). The script works when the deployment account is added to Administrators group, but that's what I'm trying to avoid.

The deployment account has Full Control on the deployed folder (and specifically the folder I'm attempting to share).

Creating the share as an admin beforehand is not an option.

Predictably, googling the issue produces tons of resources for configuring permissions to access network shares, but none discuss the permissions required to actually create a share.

Best Answer

Administrative rights are needed to create new shares.

It is not supported to delegate this permission; however it may be possible by heavily modifying the registry, but I would not recommend that.

Related Topic