Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How can I create a share with New-SmbShare and specify a Local Group

$
0
0

Using the New-SmbShare cmdlet in Powershell 3.0, I would like to create a share and specify a Local Group as the ReadAccess group. Code looks basically like:

$serverName = "Server01"
$groupName = "Share Readers"
$secGroup = "$serverName\$groupName"

$shareName = "TEMP"
$sharePath = "C:\TEMP"

New-SmbShare -Name $shareName -Path $sharePath -ContinuouslyAvailable $TRUE -ReadAccess $secGroup -CachingMode NONE

When I run this, I get the following output:

New-SmbShare : The request is not supported.
At line:1 char:1
+ New-SmbShare -Name "TEMP" -Path "C:\TEMP" -ContinuouslyAvailable $TRUE ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (MSFT_SMBShare:ROOT/Microsoft/Windows/SMB/MSFT_SMBShare) [New-SmbShare
], CimException
+ FullyQualifiedErrorId : Windows System Error 50,New-SmbShare

HELP!!!!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>