Hi.
This is the ontap PS module way:
http://www.craig-tolley.co.uk/2016/02/09/assigning-permissions-to-a-volume-through-the-netapp-powershell-toolkit/
however i think that set-acl is the easier way i'm adding below a function i'm using in my provision script that elevate the permission with Invoke-Command. also - as you start with everyone/full control you acutely only need permission on the share to change the ACL with whatever user you running with (if' it's authenticating). so you can create the share with the default access list, apply NTFS ACL and then only changes the share access list as well.
use with:
Set-MyPermission -MyPath "\\filer\share\" -MyCred (get-credential)
Function Set-MyPermission
{
[CmdletBinding()]
param($MyPath,$MyCred)
$MyPSSession = New-PSSession -Credential $MyCred
Invoke-Command -Session $MyPSSession -ArgumentList $MyPath -ScriptBlock `
{
param([string]$MyPath)
try
{
$MyObjacl = Get-ACL $MyPath
}
Catch
{
Write-Error -Category InvalidData -message "Could not get current Folder ACL"
return
}
try
{
$MyAclRule = New-Object System.Security.AccessControl.FileSystemAccessRule(("RW_Group"),"Modify","ContainerInherit, ObjectInherit", "Allow", "Allow")
$MyObjacl.AddAccessRule($MyAclRule)
#add more lines as above here
}
catch
{
Write-Error -Category InvalidData -message "Failed to use one or more of the groups to create the ACE"
return
}
try
{
Set-Acl $MyPath $MyObjacl
}
Catch
{
Write-Error -Category InvalidData -message "Failed apply the ACE on the folder"
$MyObjacl
return
}
}
Remove-PSSession $MyPSSession
}
Gidi