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

Using variables for the arguments in the Grant-SMBShareAccess cmdlet

$
0
0

The variable for the share was evaluated but the value of the variable represented by the share permissions was not. Is there a way to evaluate its value?

 Grant-SmbShareAccess -Name $SHARE -AccessRight Read -AccountName $SHARERead
Grant-SmbShareAccess : Cannot validate argument on parameter 'Name'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At line:1 char:36+         Grant-SmbShareAccess -Name $SHARE -AccessRight Read -AccountN ...+                                    ~~~~~~+ CategoryInfo          : InvalidData: (:) [Grant-SmbShareAccess], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationError,Grant-SmbShareAccess



Viewing all articles
Browse latest Browse all 21975

Trending Articles



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