Posts

Showing posts from September, 2025

Create multiple Azure files shares using Powershell

If you have to create multiple shares for an Azure files instance as part of a migration or new deployment it can be very time consuming. With this script you put the name of the shares in a txt file called "shares.txt" and it will loop through and create them all and assign them to the hot tier. <# .SYNOPSIS Created by James Lambert www.roonics.com .DESCRIPTION This script creates shares from a txt file in Azure and set's their access tier .EXAMPLE .OUTPUTS .NOTES #> # CONFIG START $file = Get-Content -Path "shares.txt" $accessTier = "Hot" $tenant = "<tenant id>" $subscription = "<subscription id>" $resourceGroupName = "<resource group>" $storageAccountName = "<storage account name>" # CONFIG END # CONNECT TO AZURE Connect-AzAccount -Tenant $tenant -SubscriptionId $subscription # GET STORAGE KEY $storageKey = (Get-AzStorageAccountKey ` -ResourceGroupName $resour...