Grant Permissions to Folder Share
Grant-SmbShareAccess -name $ShareName -AccountName $Account -AccessRight Full -Force
Revoke All Permissions From Folder Share
Get-SmbShareAccess -name $ShareName | Foreach {Revoke-SmbShareAccess -name $ShareName -AccountName $_.AccountName -Force}
Create a Folder Share
$Shares=[WMICLASS]'WIN32_Share' $sd = ([WMIClass] "Win32_SecurityDescriptor").CreateInstance() $shares.create($FolderPath, $ShareName, 0, 100, "Description", "", $sd)