<# Below script used to fetch FSLogix User Profile Size Report after mapping Azure file share as a Network Drive Firstly, Map the Azure file share as Mapped Drive and execute below script #> $Date = Get-Date -Format dd-MM-yyyy $FSLogixShareUsers = Get-ChildItem -Recurse -Path "\\.core.windows.net\" | Where-Object {$_.Name -like "*.VHDX"} ForEach($User in $FSLogixShareUsers){ $Username = ($User.Name).Split('_')[1] | ForEach{$_.SubString(0,$_.length-5)} $Profile = ($User.Length | Measure-Object -Sum).Sum /1GB | Out-String $ProfileSize = $Profile | ForEach{$_.SubString(0,$_.Length-8)+"GB"} $Report = New-Object PSObject # Creates a Custom Report # $Report | Add-Member -MemberType NoteProperty -Name Username -Value $Username $Report | Add-Member -MemberType NoteProperty -Name ProfileSize -Value $ProfileSize $Report | Export-Csv -NoTypeInformation -Append -Path ('C:\reports\FSLogix_Share_Report_profilecontainer'+$Date+'.csv') } $FSLogixShare = ((Get-ChildItem -Recurse -Path "\\.core.windows.net\" | Where-Object {$_.Name -like "*.VHDX"} | Measure-Object Length -Sum).Sum /1GB) | Out-String $FSLogixShareSize = $FSLogixShare.Split('.')[0]+"GB"