Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, February 18, 2014 8:38 PM
Can anyone tell me if there are system requirments to using PowerShell's New-SmbShare cmdlet? I'm trying to create a script that will create the folder, create the share, create groups based on the share name, and assign the appropriate NTFS persmissions and share permissions. When I try to run New-SmbShare on my Windows 8, I get the following error:
New-SmbShare : Access is denied.
At line:1 char:1
+ New-SmbShare -Name ISOs -Path C:\Shares\ISOs -FolderEnumerationMode AccessBased ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (MSFT_SMBShare:ROOT/Microsoft/Windows/SMB/MSFT_SMBShare) [New-SmbShare], CimException
+ FullyQualifiedErrorId : Windows System Error 5,New-SmbShare
I'm an administrator on the laptop, and local Administrators have Full Control at the NTFS level.
Thanks!
All replies (3)
Tuesday, February 18, 2014 8:43 PM âś…Answered | 1 vote
Have you tried opening powershell as admin? So I believe in Windows 8 (Haven't used it too much), right click and choose run as administrator, then try running it again.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Tuesday, February 18, 2014 8:51 PM | 1 vote
Not elevating your shell or the ISE was my first thought, as well. Right-click and Run as administrator. Here's an example of me trying the same command in a non-elevated shell and an elevated shell (see 'Administrator' in title bar).
Tuesday, February 18, 2014 8:52 PM
That did it. Thanks!