Translate

Azure Virtual Desktop Page

Azure Virtual Desktop Resources (incl. labs)

(updated 21/10/2021 - added AVD Client Cleanup Script)



AVD Exercise 1 (Create host pool from Azure Portal)

AVD Exercise 2 (Create application groups and assign to users)

AVD Exercise 3 (Access the published Desktop using browser)

AVD Exercise 4 (Access the published Desktop using WVD client)

AVD Exercise 5 (Setup FSLogix)

AVD Exercise 6 (Monitoring using Log Analytics)

AVD Exercise 7 (Loadbalancing methods)

AVD Exercise 8 (Create a master image from WVD)


Powershell Script to install FSLogix in a lab environment!

(Take care of the StorageAccount name. You need to change it in line 2!)

#Variables

$storageAccountName = "NameofStorageAccount" 


#Create Directories

$LabFilesDirectory = "C:\LabFiles"


if(!(Test-path -Path "$LabFilesDirectory")){

New-Item -Path $LabFilesDirectory -ItemType Directory |Out-Null

}

if(!(Test-path -Path "$LabFilesDirectory\FSLogix")){

New-Item -Path "$LabFilesDirectory\FSLogix" -ItemType Directory |Out-Null

}


 #Download FSLogix Installation bundle


 if(!(Test-path -Path "$LabFilesDirectory\FSLogix_Apps_Installation.zip")){

       Invoke-WebRequest -Uri "https://experienceazure.blob.core.windows.net/templates/wvd/FSLogix_Apps_Installation.zip" -OutFile     "$LabFilesDirectory\FSLogix_Apps_Installation.zip"


 #Extract the downloaded FSLogix bundle

 function Expand-ZIPFile($file, $destination){

     $shell = new-object -com shell.application

     $zip = $shell.NameSpace($file)

     foreach($item in $zip.items()){

     $shell.Namespace($destination).copyhere($item)

     }

 }


 Expand-ZIPFile -File "$LabFilesDirectory\FSLogix_Apps_Installation.zip" -Destination "$LabFilesDirectory\FSLogix"


}

   #Install FSLogix

   if(!(Get-WmiObject -Class Win32_Product | where vendor -eq "FSLogix, Inc." | select Name, Version)){

       $pathvargs = {C:\LabFiles\FSLogix\x64\Release\FSLogixAppsSetup.exe /quiet /install }

       Invoke-Command -ScriptBlock $pathvargs

   }

   #Create registry key 'Profiles' under 'HKLM:\SOFTWARE\FSLogix'

   $registryPath = "HKLM:\SOFTWARE\FSLogix\Profiles"

   if(!(Test-path $registryPath)){

       New-Item -Path $registryPath -Force | Out-Null

   }


   #Add registry values to enable FSLogix profiles, add VHD Locations, Delete local profile and FlipFlop Directory name

   New-ItemProperty -Path $registryPath -Name "VHDLocations" -Value "\\$storageAccountName.file.core.windows.net\userprofile" -PropertyType String -Force | Out-Null

   New-ItemProperty -Path $registryPath -Name "Enabled" -Value 1 -PropertyType DWord -Force | Out-Null

   New-ItemProperty -Path $registryPath -Name "DeleteLocalProfileWhenVHDShouldApply" -Value 1 -PropertyType DWord -Force | Out-Null

   New-ItemProperty -Path $registryPath -Name "FlipFlopProfileDirectoryName" -Value 1 -PropertyType DWord -Force | Out-Null


   #Display script completion in the console

   Write-Host "Script Executed successfully"


Image Customization Script (with GUI)

Script it self WVD/Image-Build/Customizations at master · shawntmeyer/WVD (github.com)

Automatic Download via this link: DownGit (minhaskamal.github.io)


Example Script for LogAnalytics Queries

WVDConnections 

|sort by TimeGenerated asc, CorrelationId

 |summarize Connectcount = dcount(CorrelationId) by bin(TimeGenerated, 1d),UserName = toupper(trim_end("@.*",UserName))


Automatic Scaling (how to and script)


AVD Client Cleanup (Script)