Copy Azure Permissions
I was replacing an old service account with a service principal, and needed to replicate the permissions in Azure. I was able to do that without missing anything, using the command below. $CopyFrom = 'Object to copy from' $CopyTo = 'Object to copy to' Get-AzRoleAssignment -ObjectId $CopyFrom | ForEach-Object{ New-AzRoleAssignment -ObjectId $CopyTo -RoleDefinitionId $_.RoleDefinitionId -Scope $_.Scope }
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}