Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save soulemike/d5f860b37b1ddc55dcb29fbfbfe004f6 to your computer and use it in GitHub Desktop.
Save soulemike/d5f860b37b1ddc55dcb29fbfbfe004f6 to your computer and use it in GitHub Desktop.
Set all Azure Files for default permissions
#https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-assign-permissions?tabs=azure-powershell#share-level-permissions-for-all-authenticated-identities
Get-AzStorageAccount|%{
$x=$_;
$_.AzureFilesIdentityBasedAuth|?{$_.DefaultSharePermission -eq $null}|%{
Set-AzStorageAccount -DefaultSharePermission "StorageFileDataSmbShareContributor" -ResourceGroupName $x.ResourceGroupName -AccountName $x.StorageAccountName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment