├── .gitignore ├── AVD--Bicep ├── Main.bicep ├── Modules │ ├── AVDCore.bicep │ ├── AVDHost.bicep │ ├── Bastian.bicep │ ├── Firewall.bicep │ ├── KeyVault.bicep │ ├── RGBuild.bicep │ └── vnet.bicep ├── _Previous │ ├── AVD.Bicep │ └── AVDArchitect.Bicep └── test.excalidraw.png ├── AZ-140 WVD FastHack Scenario.docx ├── AZ-140-NetworkHubBuild.json ├── AZ-140-RGBuild.json ├── PowerShell ├── 0_AppAttach - Template.ps1 ├── 15-AZ-140 - CLI.txt ├── 15-AZ-140 - PowerShell.ps1 ├── AADKerberos.ps1 ├── ADFS │ ├── ADFS Customizations.ps1 │ └── ADFS SSO.ps1 ├── Configure WVD.ps1 ├── Ephemeral-Sizes.ps1 ├── FSLogix100Cloud CloudCache.ps1 ├── FSLogix100Cloud.ps1 ├── FSLogixSettingsOnly.ps1 ├── FSLogixSetup.ps1 ├── MSIX App Attach Migration.ps1 ├── New-AVD-Win11-Host.ps1 ├── New-WVDSessionHost.ps1 ├── OneDrive for AVD.ps1 ├── RenameComputer.ps1 ├── SetupWVD.ps1 ├── Tagging Image Updates.ps1 ├── Teams-AVRedirection ├── WVD - Diag Setup.ps1 ├── WVD Module.ps1 ├── WVD-Scaling-Automation.ps1 ├── WVDOptimize.ps1 ├── WVD_AAD_SVC_Prin.ps1 ├── Win365 AIB Process.ps1 ├── __Runbook Image Update.ps1 ├── ___AVD_Get App Group Assignment.ps1 └── redirections.xml ├── Recast └── ImageAgentDeploy.ps1 ├── Storage.bicep ├── WVD Hack Network Architecture.png ├── WVD Hack Network Architecture.vsdx ├── WVD Permissions ├── AzureAutomation-Start-Stop.json ├── Desktop Virtualization Application Group Contributor.json ├── Desktop Virtualization Application Group Owner.json ├── Desktop Virtualization Application Group Reader.json ├── Desktop Virtualization AutoScale.json ├── Desktop Virtualization HostPool Contributor.json ├── Desktop Virtualization HostPool Owner.json ├── Desktop Virtualization HostPool Reader.json ├── Desktop Virtualization Owner.json ├── Desktop Virtualization Session Host Config Reader.json ├── Desktop Virtualization Start VM On Connect.json ├── Desktop Virtualization User Admin.json ├── Desktop Virtualization Workspace Contributor.json ├── Desktop Virtualization Workspace Owner.json ├── Desktop Virtualization Workspace Reader.json └── HostPoolUpdate-RBAC.json └── WVDTemplates ├── .vs ├── WVD-NewHost │ ├── DesignTimeBuild │ │ ├── .dtbcache │ │ └── .dtbcache.v2 │ ├── config │ │ └── applicationhost.config │ ├── v15 │ │ └── .suo │ └── v16 │ │ └── .suo └── config │ └── applicationhost.config ├── AVDPrivateLink.json ├── AVDPrivateLink.parameters.json ├── AzureFirewall.json ├── AzureImageBuilder.json ├── WVD Resource Templates ├── New-DesktopAppGroup.json ├── New-DesktopAppGroup.parameters.json ├── New-HostPool.json └── New-HostPool.parameters.json ├── WVD-NSG.json ├── WVD-NewHost.sln └── WVD-NewHost ├── AVD-NewAADJoinHost.json ├── AVD-Win10-TrustedLaunch.json ├── AVD-Win11-NewHost.json ├── AVD-Win11-NewHost.parameters.json ├── Deploy-AzureResourceGroup.ps1 ├── Deployment.targets ├── Lighthouse.json ├── README.md ├── WVD-NewEphemeralHost.json ├── WVD-NewEphemeralHost.parameters.json ├── WVD-NewHost.bicep ├── WVD-NewHost.deployproj ├── WVD-NewHost.json ├── WVD-NewHost.parameters.json ├── customimage ├── New-CustomHost.json └── New-CustomHost.parameters.json ├── lighthouse.parameters.json └── old ├── azuredeploy.json └── azuredeploy.parameters.json /.gitignore: -------------------------------------------------------------------------------- 1 | Office365-Scripts/Office365NetworkTools/ 2 | -------------------------------------------------------------------------------- /AVD--Bicep/Main.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param AdminUserName string = 'lntad' 5 | @description('Please enter the admin password') 6 | @secure() 7 | param AdminPassword string 8 | param Location string 9 | param NamePrefix string 10 | param AddressSpace string 11 | @minValue(1) 12 | @maxValue(99) 13 | param NumberOfHosts int 14 | @allowed([ 15 | 'Win10' 16 | 'Win11' 17 | ]) 18 | param HostOS string 19 | @allowed([ 20 | 'Small' 21 | 'Medium' 22 | 'Large' 23 | ]) 24 | param VMSize string = 'Small' 25 | 26 | 27 | /*################# 28 | # Variables # 29 | #################*/ 30 | var randomString = substring(uniqueString(RGShared.name), 0, 4) 31 | 32 | 33 | /*################## 34 | # Resources # 35 | ##################*/ 36 | targetScope = 'subscription' 37 | 38 | resource RGShared 'Microsoft.Resources/resourceGroups@2024-11-01' = { 39 | name: 'RG-${NamePrefix}-Shared' 40 | location: Location 41 | } 42 | 43 | resource RGAVD 'Microsoft.Resources/resourceGroups@2024-11-01' = { 44 | name: 'RG-${NamePrefix}-AVD' 45 | location: Location 46 | } 47 | 48 | //Virtual Networks 49 | module VNET 'Modules/vnet.bicep' = { 50 | scope: resourceGroup(RGShared.name) 51 | name: 'Deploy-VNet' 52 | params: { 53 | Name: '${NamePrefix}-VNET' 54 | Location: Location 55 | AddressSpace: AddressSpace 56 | } 57 | } 58 | 59 | //Network Security 60 | module Firewall 'Modules/Firewall.bicep' = { 61 | scope: resourceGroup(RGShared.name) 62 | name: 'Deploy-Firewall' 63 | params: { 64 | FWName: '${NamePrefix}-FW' 65 | Location: Location 66 | FWMgtSubnet: VNET.outputs.FirewallMgtSubnetID 67 | FirewallSubnet: VNET.outputs.FirewallSubnetID 68 | } 69 | } 70 | 71 | module Bastion 'Modules/Bastian.bicep' = { 72 | scope: resourceGroup(RGShared.name) 73 | name: 'Deploy-Bastion' 74 | params: { 75 | BastionName: '${NamePrefix}-Bastion' 76 | Location: Location 77 | BastionSubnet: VNET.outputs.BastionSubnetID 78 | } 79 | } 80 | 81 | module KeyVault 'Modules/KeyVault.bicep' = { 82 | scope: resourceGroup(RGShared.name) 83 | name: 'Deploy-KeyVault' 84 | params: { 85 | KVName: '${NamePrefix}-KV-${randomString}' 86 | Location: Location 87 | AdminPassword: AdminPassword 88 | } 89 | } 90 | 91 | //Azure Virtual Desktop 92 | module AVDCore 'Modules/AVDCore.bicep' = { 93 | scope: resourceGroup(RGAVD.name) 94 | name: 'Deploy-AVDCore' 95 | params: { 96 | HPName: '${NamePrefix}-HP' 97 | DesktopGroupName: '${NamePrefix}-DAG' 98 | AppGroupName: '${NamePrefix}-RAG' 99 | WorkspaceName: '${NamePrefix}-WS' 100 | ScalingPlanName: '${NamePrefix}-SP' 101 | Location: Location 102 | } 103 | } 104 | 105 | module AVDHost 'Modules/AVDHost.bicep' = { 106 | scope: resourceGroup(RGAVD.name) 107 | name: 'Deploy-AVDHosts' 108 | params: { 109 | HostPoolName: AVDCore.outputs.HostPoolName 110 | NamePrefix: NamePrefix 111 | Subnet: VNET.outputs.AVDSubnetID 112 | NumberOfHosts: NumberOfHosts 113 | Location: Location 114 | RegistrationToken: AVDCore.outputs.HostPoolToken 115 | AdminUserName: AdminUserName 116 | AdminPassword: AdminPassword 117 | HostOS: HostOS 118 | VMSize: VMSize 119 | } 120 | } 121 | 122 | /*################ 123 | # Outputs # 124 | ################*/ 125 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/AVDCore.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param HPName string 5 | param DesktopGroupName string 6 | param AppGroupName string 7 | param WorkspaceName string 8 | param ScalingPlanName string 9 | param Location string 10 | 11 | 12 | /*################# 13 | # Variables # 14 | #################*/ 15 | 16 | 17 | /*################## 18 | # Resources # 19 | ##################*/ 20 | resource HostPool 'Microsoft.DesktopVirtualization/hostPools@2024-08-08-preview' = { 21 | name: HPName 22 | location: Location 23 | properties: { 24 | friendlyName: HPName 25 | hostPoolType: 'Pooled' 26 | loadBalancerType: 'BreadthFirst' 27 | preferredAppGroupType: 'RailApplications' 28 | maxSessionLimit: 10 29 | validationEnvironment: true 30 | startVMOnConnect: true 31 | registrationInfo: { 32 | expirationTime: dateTimeAdd('2025-02-12 00:00:00Z', 'P30D') 33 | registrationTokenOperation: 'Update' 34 | } 35 | customRdpProperty: 'networkautodetect:i:1;audiomode:i:0;videoplaybackmode:i:1;bandwidthautodetect:i:1;autoreconnection enabled:i:1;devicestoredirect:s:*;redirectcomports:i:0;redirectsmartcards:i:0;enablerdsaadauth:i:1;enablecredsspsupport:i:1;redirectwebauthn:i:1;use multimon:i:0;compression:i:1;audiocapturemode:i:1;encode redirected video capture:i:1;redirected video capture encoding quality:i:1;camerastoredirect:s:*;redirectlocation:i:1;screen mode id:i:2;smart sizing:i:1;dynamic resolution:i:1;' 36 | agentUpdate: { 37 | maintenanceWindows: [ 38 | { 39 | dayOfWeek:'Saturday' 40 | hour: 2 41 | } 42 | ] 43 | maintenanceWindowTimeZone: 'EST' 44 | type: 'Scheduled' 45 | useSessionHostLocalTime: true 46 | } 47 | } 48 | } 49 | 50 | resource AppDesktop 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 51 | name: DesktopGroupName 52 | location: Location 53 | properties: { 54 | friendlyName: 'Desktop' 55 | applicationGroupType: 'Desktop' 56 | hostPoolArmPath: HostPool.id 57 | } 58 | } 59 | 60 | resource AppRemote 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 61 | name: AppGroupName 62 | location: Location 63 | properties: { 64 | friendlyName: 'RemoteApps' 65 | applicationGroupType:'RemoteApp' 66 | hostPoolArmPath: HostPool.id 67 | } 68 | } 69 | 70 | resource Workspace 'Microsoft.DesktopVirtualization/workspaces@2024-08-08-preview' = { 71 | name: WorkspaceName 72 | location: Location 73 | properties: { 74 | friendlyName: 'friendlyName' 75 | applicationGroupReferences: [ 76 | AppDesktop.id 77 | AppRemote.id 78 | ] 79 | } 80 | } 81 | 82 | resource ScalingPlan 'Microsoft.DesktopVirtualization/scalingplans@2024-04-08-preview' = { 83 | name: ScalingPlanName 84 | location: Location 85 | properties: { 86 | friendlyName: 'AVD Scaling Plan' 87 | timeZone: 'Eastern Standard Time' 88 | hostPoolType: 'Pooled' 89 | schedules: [ 90 | { 91 | rampUpStartTime: { 92 | hour: 9 93 | minute: 0 94 | } 95 | peakStartTime: { 96 | hour: 9 97 | minute: 30 98 | } 99 | rampDownStartTime: { 100 | hour: 18 101 | minute: 0 102 | } 103 | offPeakStartTime: { 104 | hour: 22 105 | minute: 0 106 | } 107 | name: 'weekdays_schedule' 108 | daysOfWeek: [ 109 | 'Monday' 110 | 'Tuesday' 111 | 'Wednesday' 112 | 'Thursday' 113 | 'Friday' 114 | ] 115 | rampUpLoadBalancingAlgorithm: 'BreadthFirst' 116 | rampUpMinimumHostsPct: 100 117 | rampUpCapacityThresholdPct: 60 118 | peakLoadBalancingAlgorithm: 'DepthFirst' 119 | rampDownLoadBalancingAlgorithm: 'DepthFirst' 120 | rampDownMinimumHostsPct: 100 121 | rampDownCapacityThresholdPct: 90 122 | rampDownForceLogoffUsers: true 123 | rampDownWaitTimeMinutes: 30 124 | rampDownNotificationMessage: 'You will be logged off in 30 min. Make sure to save your work.' 125 | rampDownStopHostsWhen: 'ZeroSessions' 126 | offPeakLoadBalancingAlgorithm: 'DepthFirst' 127 | } 128 | ] 129 | hostPoolReferences: [ 130 | { 131 | hostPoolArmPath: HostPool.id 132 | scalingPlanEnabled: true 133 | } 134 | ] 135 | } 136 | } 137 | 138 | 139 | /*################ 140 | # Outputs # 141 | ################*/ 142 | output HostPoolName string = HostPool.name 143 | output HostPoolToken string = HostPool.listRegistrationTokens().value[0].token 144 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/AVDHost.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param Location string 5 | param NamePrefix string 6 | param Subnet string 7 | param NumberOfHosts int 8 | param HostPoolName string 9 | param RegistrationToken string 10 | param AdminUserName string 11 | @secure() 12 | param AdminPassword string 13 | param HostOS string 14 | param VMSize string 15 | 16 | /*################# 17 | # Variables # 18 | #################*/ 19 | var VMSizes = { 20 | Small: { 21 | vmSize: 'Standard_B4ms' 22 | } 23 | Medium: { 24 | vmSize: 'Standard_DS3_v2' 25 | } 26 | Large: { 27 | vmSize: 'Standard_DS14_v2' 28 | } 29 | } 30 | var VMImage ={ 31 | Win11: { 32 | publisher: 'microsoftwindowsdesktop' 33 | offer: 'office-365' 34 | sku: 'win11-24h2-avd-m365' 35 | version: 'latest' 36 | } 37 | Win10: { 38 | publisher: 'MicrosoftWindowsDesktop' 39 | offer: 'Windows-10' 40 | sku: 'win10-22h2-avd-g2' 41 | version: 'latest' 42 | } 43 | } 44 | var modulesUrl = 'https://wvdportalstorageblob.blob.${environment().suffixes.storage}/galleryartifacts/Configuration_1.0.02797.442.zip' 45 | 46 | 47 | /*################## 48 | # Resources # 49 | ##################*/ 50 | resource NIC 'Microsoft.Network/networkInterfaces@2024-05-01' = [for i in range(0, NumberOfHosts): { 51 | name: '${NamePrefix}-SH-${i+1}-Nic' 52 | location: Location 53 | properties: { 54 | ipConfigurations: [ 55 | { 56 | name: 'name' 57 | properties: { 58 | privateIPAllocationMethod: 'Dynamic' 59 | subnet: { 60 | id: Subnet 61 | } 62 | } 63 | } 64 | ] 65 | } 66 | } 67 | ] 68 | 69 | resource VM 'Microsoft.Compute/virtualMachines@2024-07-01' = [ for i in range(0, NumberOfHosts): { 70 | name: '${NamePrefix}-SH-${i+1}' 71 | location: Location 72 | properties: { 73 | hardwareProfile: { 74 | vmSize: VMSizes[VMSize].vmSize 75 | } 76 | securityProfile: { 77 | securityType: 'TrustedLaunch' 78 | uefiSettings: { 79 | secureBootEnabled: true 80 | vTpmEnabled: true 81 | } 82 | } 83 | additionalCapabilities: { 84 | hibernationEnabled: false 85 | } 86 | osProfile: { 87 | computerName: '${NamePrefix}-SH-${i+1}' 88 | adminUsername: AdminUserName 89 | adminPassword: AdminPassword 90 | } 91 | storageProfile: { 92 | imageReference: { 93 | publisher: VMImage[HostOS].publisher 94 | offer: VMImage[HostOS].offer 95 | sku: VMImage[HostOS].sku 96 | version: VMImage[HostOS].version 97 | } 98 | osDisk: { 99 | name: '${NamePrefix}-SH-${i+1}-OSDisk' 100 | caching: 'ReadWrite' 101 | createOption: 'FromImage' 102 | } 103 | } 104 | diagnosticsProfile: { 105 | bootDiagnostics: { 106 | enabled: true 107 | } 108 | } 109 | networkProfile: { 110 | networkInterfaces: [ 111 | { 112 | id: NIC[i].id 113 | } 114 | ] 115 | } 116 | } 117 | } 118 | ] 119 | 120 | resource entraIdJoin 'Microsoft.Compute/virtualMachines/extensions@2024-03-01' = [ for i in range(0, NumberOfHosts):{ 121 | parent: VM[i] 122 | name: 'AADLoginForWindows' 123 | location: Location 124 | properties: { 125 | publisher: 'Microsoft.Azure.ActiveDirectory' 126 | type: 'AADLoginForWindows' 127 | typeHandlerVersion: '1.0' 128 | autoUpgradeMinorVersion: true 129 | enableAutomaticUpgrade: false 130 | } 131 | } 132 | ] 133 | 134 | resource AVDDsc 'Microsoft.Compute/virtualMachines/extensions@2024-07-01' = [ for i in range(0, NumberOfHosts):{ 135 | parent: VM[i] 136 | name: 'MicrosoftPowershellDSC' 137 | location: Location 138 | properties: { 139 | publisher: 'Microsoft.Powershell' 140 | type: 'DSC' 141 | typeHandlerVersion: '2.9' 142 | autoUpgradeMinorVersion: true 143 | settings: { 144 | modulesUrl: modulesUrl 145 | configurationFunction: 'Configuration.ps1\\AddSessionHost' 146 | properties: { 147 | hostPoolName: HostPoolName 148 | aadJoin: true 149 | } 150 | } 151 | protectedSettings: { 152 | properties: { 153 | registrationInfoToken: RegistrationToken 154 | } 155 | } 156 | } 157 | dependsOn: [ 158 | entraIdJoin 159 | ] 160 | } 161 | ] 162 | 163 | /*################ 164 | # Outputs # 165 | ################*/ 166 | 167 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/Bastian.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param BastionName string 5 | param Location string 6 | param BastionSubnet string 7 | 8 | /*################# 9 | # Variables # 10 | #################*/ 11 | 12 | 13 | /*################## 14 | # Resources # 15 | ##################*/ 16 | resource BastionPIP 'Microsoft.Network/publicIPAddresses@2024-05-01' = { 17 | name: '${BastionName}-PIP' 18 | location: Location 19 | sku: { 20 | name: 'Standard' 21 | } 22 | properties: { 23 | publicIPAllocationMethod: 'Static' 24 | } 25 | } 26 | 27 | resource bastionHost 'Microsoft.Network/bastionHosts@2021-02-01' = { 28 | name: BastionName 29 | location: Location 30 | sku: { 31 | name: 'Standard' 32 | } 33 | properties: { 34 | ipConfigurations: [ 35 | { 36 | name: 'ipconfig1' 37 | properties: { 38 | subnet: { 39 | id: BastionSubnet 40 | } 41 | publicIPAddress: { 42 | id: BastionPIP.id 43 | } 44 | } 45 | } 46 | ] 47 | } 48 | } 49 | 50 | 51 | /*################ 52 | # Outputs # 53 | ################*/ 54 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/Firewall.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param FWName string 5 | param Location string 6 | param FirewallSubnet string 7 | param FWMgtSubnet string 8 | 9 | /*################# 10 | # Variables # 11 | #################*/ 12 | 13 | 14 | /*################## 15 | # Resources # 16 | ##################*/ 17 | resource FWMgtPIP 'Microsoft.Network/publicIPAddresses@2024-05-01' = { 18 | name: '${FWName}-MgtPIP' 19 | location: Location 20 | sku: { 21 | name: 'Standard' 22 | } 23 | properties: { 24 | publicIPAllocationMethod: 'Static' 25 | } 26 | } 27 | 28 | resource FWPIP 'Microsoft.Network/publicIPAddresses@2024-05-01' = { 29 | name: '${FWName}-PIP' 30 | location: Location 31 | sku: { 32 | name: 'Standard' 33 | } 34 | properties: { 35 | publicIPAllocationMethod: 'Static' 36 | } 37 | } 38 | 39 | resource firewallPolicy 'Microsoft.Network/firewallPolicies@2024-05-01' = { 40 | name: '${FWName}-FWP' 41 | location: Location 42 | properties: { 43 | sku: { 44 | tier: 'Basic' 45 | } 46 | } 47 | } 48 | 49 | resource firewall 'Microsoft.Network/azureFirewalls@2021-05-01' = { 50 | name: FWName 51 | location: Location 52 | properties: { 53 | sku: { 54 | name: 'AZFW_VNet' 55 | tier: 'Basic' 56 | } 57 | managementIpConfiguration: { 58 | name: 'ManagementIPConfig' 59 | properties: { 60 | publicIPAddress: { 61 | id: FWMgtPIP.id 62 | } 63 | subnet: { 64 | id: FWMgtSubnet 65 | } 66 | } 67 | } 68 | firewallPolicy: { 69 | id: firewallPolicy.id 70 | } 71 | ipConfigurations: [ 72 | { 73 | name: 'name' 74 | properties: { 75 | subnet: { 76 | id: FirewallSubnet 77 | } 78 | publicIPAddress: { 79 | id: FWPIP.id 80 | } 81 | } 82 | } 83 | ] 84 | } 85 | } 86 | 87 | 88 | 89 | /*################ 90 | # Outputs # 91 | ################*/ 92 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/KeyVault.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param KVName string 5 | param Location string 6 | @secure() 7 | param AdminPassword string 8 | 9 | /*################# 10 | # Variables # 11 | #################*/ 12 | var KVURL = 'https://${KVName}.vault.azure.net/' 13 | 14 | 15 | /*################## 16 | # Resources # 17 | ##################*/ 18 | resource KVName_resource 'Microsoft.KeyVault/vaults@2024-04-01-preview' = { 19 | name: KVName 20 | location: Location 21 | properties: { 22 | sku: { 23 | family: 'A' 24 | name: 'standard' 25 | } 26 | tenantId: tenant().tenantId 27 | enabledForDeployment: true 28 | enabledForDiskEncryption: true 29 | enabledForTemplateDeployment: true 30 | enableSoftDelete: true 31 | softDeleteRetentionInDays: 90 32 | enableRbacAuthorization: true 33 | vaultUri: KVURL 34 | provisioningState: 'Succeeded' 35 | publicNetworkAccess: 'Enabled' 36 | } 37 | } 38 | 39 | resource KVName_DomainJoin_Password 'Microsoft.KeyVault/vaults/secrets@2024-04-01-preview' = { 40 | parent: KVName_resource 41 | name: 'DomainJoin--Password' 42 | properties: { 43 | attributes: { 44 | enabled: true 45 | } 46 | value:AdminPassword 47 | } 48 | } 49 | 50 | resource KVName_DomainJoin_User 'Microsoft.KeyVault/vaults/secrets@2024-04-01-preview' = { 51 | parent: KVName_resource 52 | name: 'DomainJoin--UserName' 53 | properties: { 54 | attributes: { 55 | enabled: true 56 | } 57 | value:'adjoin@MSAzureAcademy.com' 58 | } 59 | } 60 | 61 | resource KVName_LocalAdmin_Password 'Microsoft.KeyVault/vaults/secrets@2024-04-01-preview' = { 62 | parent: KVName_resource 63 | name: 'LocalAdmin--Password' 64 | properties: { 65 | attributes: { 66 | enabled: true 67 | } 68 | value:AdminPassword 69 | } 70 | } 71 | 72 | resource KVName_LocalAdmin_User 'Microsoft.KeyVault/vaults/secrets@2024-04-01-preview' = { 73 | parent: KVName_resource 74 | name: 'LocalAdmin--UserName' 75 | properties: { 76 | attributes: { 77 | enabled: true 78 | } 79 | value: 'lntad' 80 | } 81 | } 82 | 83 | /*################ 84 | # Outputs # 85 | ################*/ 86 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/RGBuild.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param Name string 5 | param Location string 6 | 7 | 8 | /*################# 9 | # Variables # 10 | #################*/ 11 | 12 | 13 | /*################## 14 | # Resources # 15 | ##################*/ 16 | targetScope = 'subscription' 17 | 18 | resource RGShared 'Microsoft.Resources/resourceGroups@2024-11-01' = { 19 | name: '${Name}-Shared' 20 | location: Location 21 | } 22 | 23 | resource RGAVD 'Microsoft.Resources/resourceGroups@2024-11-01' = { 24 | name: '${Name}-AVD' 25 | location: Location 26 | } 27 | 28 | 29 | /*################ 30 | # Outputs # 31 | ################*/ 32 | output RGsharedName string = RGShared.name 33 | output RGavdName string = RGAVD.name 34 | -------------------------------------------------------------------------------- /AVD--Bicep/Modules/vnet.bicep: -------------------------------------------------------------------------------- 1 | /*################## 2 | # Parameters # 3 | ##################*/ 4 | param Location string 5 | param Name string 6 | param AddressSpace string 7 | 8 | 9 | /*################# 10 | # Variables # 11 | #################*/ 12 | var addressParts = split(AddressSpace, '.') 13 | var baseAddress = '${addressParts[0]}.${addressParts[1]}' 14 | var sharedServicesSubnet = '${baseAddress}.1.0/24' 15 | var azureFirewallManagementSubnet = '${baseAddress}.2.0/24' 16 | var azureFirewallSubnet = '${baseAddress}.3.0/24' 17 | var azureBastionSubnet = '${baseAddress}.4.0/24' 18 | var avdSubnet = '${baseAddress}.5.0/24' 19 | var win365Subnet = '${baseAddress}.6.0/24' 20 | 21 | 22 | /*################## 23 | # Resources # 24 | ##################*/ 25 | resource VNET 'Microsoft.Network/virtualNetworks@2020-11-01' = { 26 | name: Name 27 | location: Location 28 | properties: { 29 | addressSpace: { 30 | addressPrefixes: [ 31 | AddressSpace 32 | ] 33 | } 34 | subnets: [ 35 | {name: 'SharedServicesSubnet' 36 | properties: { 37 | addressPrefix: sharedServicesSubnet 38 | } 39 | } 40 | { 41 | name: 'AzureFirewallManagementSubnet' 42 | properties: { 43 | addressPrefix: azureFirewallManagementSubnet 44 | } 45 | } 46 | { 47 | name: 'AzureFirewallSubnet' 48 | properties: { 49 | addressPrefix: azureFirewallSubnet 50 | } 51 | } 52 | { 53 | name: 'AzureBastionSubnet' 54 | properties: { 55 | addressPrefix: azureBastionSubnet 56 | } 57 | } 58 | { 59 | name: 'AVDSubnet' 60 | properties: { 61 | addressPrefix: avdSubnet 62 | } 63 | } 64 | { 65 | name: 'Win365Subnet' 66 | properties: { 67 | addressPrefix: win365Subnet 68 | } 69 | } 70 | ] 71 | } 72 | } 73 | 74 | 75 | /*################ 76 | # Outputs # 77 | ################*/ 78 | output SharedSubnetID string = '${VNET.id}/subnets/SharedServicesSubnet' 79 | output FirewallMgtSubnetID string = '${VNET.id}/subnets/AzureFirewallManagementSubnet' 80 | output FirewallSubnetID string = '${VNET.id}/subnets/AzureFirewallSubnet' 81 | output BastionSubnetID string = '${VNET.id}/subnets/AzureBastionSubnet' 82 | output AVDSubnetID string = '${VNET.id}/subnets/AVDSubnet' 83 | output Win365SubnetID string = '${VNET.id}/subnets/Win365Subnet' 84 | 85 | -------------------------------------------------------------------------------- /AVD--Bicep/_Previous/AVD.Bicep: -------------------------------------------------------------------------------- 1 | param AdminUserName string = 'lntad' 2 | 3 | @description('Please enter the admin password') 4 | @secure() 5 | param AdminPassword string 6 | 7 | var modulesUrl = 'https://wvdportalstorageblob.blob.${environment().suffixes.storage}/galleryartifacts/Configuration_1.0.02797.442.zip' 8 | 9 | resource HostPool 'Microsoft.DesktopVirtualization/hostPools@2024-08-08-preview' = { 10 | name: 'Bicep-HP' 11 | location: 'eastus2' 12 | properties: { 13 | friendlyName: 'hostpoolFriendlyName' 14 | hostPoolType: 'Pooled' 15 | loadBalancerType: 'BreadthFirst' 16 | preferredAppGroupType: 'RailApplications' 17 | maxSessionLimit: 10 18 | validationEnvironment: true 19 | startVMOnConnect: true 20 | registrationInfo: { 21 | expirationTime: dateTimeAdd('2025-01-19 00:00:00Z', 'P2D') 22 | registrationTokenOperation: 'Update' 23 | } 24 | } 25 | } 26 | 27 | resource AppDesktop 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 28 | name: 'Bicep-App-Desktop' 29 | location: 'eastus2' 30 | properties: { 31 | friendlyName: 'Desktop' 32 | applicationGroupType: 'Desktop' 33 | hostPoolArmPath: HostPool.id 34 | } 35 | } 36 | 37 | resource AppRemote 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 38 | name: 'Bicep-App-RemoteApps' 39 | location: 'eastus2' 40 | properties: { 41 | friendlyName: 'RemoteApps' 42 | applicationGroupType:'RemoteApp' 43 | hostPoolArmPath: HostPool.id 44 | } 45 | } 46 | 47 | resource Workspace 'Microsoft.DesktopVirtualization/workspaces@2024-08-08-preview' = { 48 | name: 'Bicep-WS' 49 | location: 'eastus2' 50 | properties: { 51 | friendlyName: 'friendlyName' 52 | applicationGroupReferences: [ 53 | AppDesktop.id 54 | AppRemote.id 55 | ] 56 | } 57 | } 58 | 59 | resource Subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' existing = { 60 | name: 'VNET-Cloud-VDI/AVD-1' 61 | } 62 | 63 | resource NIC 'Microsoft.Network/networkInterfaces@2024-05-01' = { 64 | name: 'Bicep-SH-1-Nic' 65 | location: 'eastus2' 66 | properties: { 67 | ipConfigurations: [ 68 | { 69 | name: 'name' 70 | properties: { 71 | privateIPAllocationMethod: 'Dynamic' 72 | subnet: { 73 | id: Subnet.id 74 | } 75 | } 76 | } 77 | ] 78 | } 79 | } 80 | 81 | resource VM 'Microsoft.Compute/virtualMachines@2024-07-01' = { 82 | name: 'Bicep-SH-1' 83 | location: 'eastus2' 84 | properties: { 85 | hardwareProfile: { 86 | vmSize: 'Standard_B4ms' 87 | } 88 | osProfile: { 89 | computerName: 'SH-1' 90 | adminUsername: AdminUserName 91 | adminPassword: AdminPassword 92 | } 93 | storageProfile: { 94 | imageReference: { 95 | publisher: 'microsoftwindowsdesktop' 96 | offer: 'office-365' 97 | sku: 'win11-24h2-avd-m365' 98 | version: 'latest' 99 | } 100 | osDisk: { 101 | name: 'Bicep-SH-1-OSDisk' 102 | caching: 'ReadWrite' 103 | createOption: 'FromImage' 104 | } 105 | } 106 | networkProfile: { 107 | networkInterfaces: [ 108 | { 109 | id: NIC.id 110 | } 111 | ] 112 | } 113 | } 114 | } 115 | 116 | resource entraIdJoin 'Microsoft.Compute/virtualMachines/extensions@2024-03-01' = { 117 | parent: VM 118 | name: 'AADLoginForWindows' 119 | location: 'eastus2' 120 | properties: { 121 | publisher: 'Microsoft.Azure.ActiveDirectory' 122 | type: 'AADLoginForWindows' 123 | typeHandlerVersion: '1.0' 124 | autoUpgradeMinorVersion: true 125 | enableAutomaticUpgrade: false 126 | } 127 | } 128 | 129 | resource AVDDsc 'Microsoft.Compute/virtualMachines/extensions@2024-07-01' = { 130 | parent: VM 131 | name: 'Bicep-SH-1-DSC' 132 | location: 'eastus2' 133 | properties: { 134 | publisher: 'Microsoft.Powershell' 135 | type: 'DSC' 136 | typeHandlerVersion: '2.9' 137 | autoUpgradeMinorVersion: true 138 | settings: { 139 | modulesUrl: modulesUrl 140 | configurationFunction: 'Configuration.ps1\\AddSessionHost' 141 | properties: { 142 | hostPoolName: HostPool.name 143 | aadJoin: true 144 | } 145 | } 146 | protectedSettings: { 147 | properties: { 148 | registrationInfoToken: HostPool.listRegistrationTokens().value[0].token 149 | } 150 | } 151 | } 152 | dependsOn: [ 153 | entraIdJoin 154 | ] 155 | } 156 | -------------------------------------------------------------------------------- /AVD--Bicep/_Previous/AVDArchitect.Bicep: -------------------------------------------------------------------------------- 1 | param AdminUserName string = 'lntad' 2 | 3 | @description('Please enter the admin password') 4 | @secure() 5 | param AdminPassword string 6 | 7 | param Location string 8 | 9 | param prefix string 10 | 11 | @allowed([ 12 | 'Win10' 13 | 'Win11' 14 | ]) 15 | param HostOS string 16 | 17 | @allowed([ 18 | 'Small' 19 | 'Medium' 20 | 'Large' 21 | ]) 22 | param VMSize string = 'Small' 23 | 24 | @minValue(1) 25 | @maxValue(99) 26 | param NumberOfHosts int 27 | 28 | 29 | var VMSizes = { 30 | Small: { 31 | vmSize: 'Standard_B4ms' 32 | } 33 | Medium: { 34 | vmSize: 'Standard_DS3_v2' 35 | } 36 | Large: { 37 | vmSize: 'Standard_DS14_v2' 38 | } 39 | } 40 | 41 | var VMImage ={ 42 | Win11: { 43 | publisher: 'microsoftwindowsdesktop' 44 | offer: 'office-365' 45 | sku: 'win11-24h2-avd-m365' 46 | version: 'latest' 47 | } 48 | Win10: { 49 | publisher: 'MicrosoftWindowsDesktop' 50 | offer: 'Windows-10' 51 | sku: 'win10-22h2-avd-g2' 52 | version: 'latest' 53 | } 54 | } 55 | 56 | var modulesUrl = 'https://wvdportalstorageblob.blob.${environment().suffixes.storage}/galleryartifacts/Configuration_1.0.02797.442.zip' 57 | 58 | resource HostPool 'Microsoft.DesktopVirtualization/hostPools@2024-08-08-preview' = { 59 | name: '${prefix}-HP' 60 | location: Location 61 | properties: { 62 | friendlyName: 'hostpoolFriendlyName' 63 | hostPoolType: 'Pooled' 64 | loadBalancerType: 'BreadthFirst' 65 | preferredAppGroupType: 'RailApplications' 66 | maxSessionLimit: 10 67 | validationEnvironment: true 68 | startVMOnConnect: true 69 | registrationInfo: { 70 | expirationTime: dateTimeAdd('2025-01-27 00:00:00Z', 'P31D') 71 | registrationTokenOperation: 'Update' 72 | } 73 | } 74 | } 75 | 76 | resource AppDesktop 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 77 | name: '${prefix}-App-Desktop' 78 | location: Location 79 | properties: { 80 | friendlyName: 'Desktop' 81 | applicationGroupType: 'Desktop' 82 | hostPoolArmPath: HostPool.id 83 | } 84 | } 85 | 86 | resource AppRemote 'Microsoft.DesktopVirtualization/applicationGroups@2024-08-08-preview' = { 87 | name: '${prefix}-App-RemoteApps' 88 | location: Location 89 | properties: { 90 | friendlyName: 'RemoteApps' 91 | applicationGroupType:'RemoteApp' 92 | hostPoolArmPath: HostPool.id 93 | } 94 | } 95 | 96 | resource Workspace 'Microsoft.DesktopVirtualization/workspaces@2024-08-08-preview' = { 97 | name: '${prefix}-WS' 98 | location: Location 99 | properties: { 100 | friendlyName: 'friendlyName' 101 | applicationGroupReferences: [ 102 | AppDesktop.id 103 | AppRemote.id 104 | ] 105 | } 106 | } 107 | 108 | resource Subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' existing = { 109 | name: 'VNET-Cloud-VDI/AVD-1' 110 | } 111 | 112 | resource NIC 'Microsoft.Network/networkInterfaces@2024-05-01' = [for i in range(0, NumberOfHosts): { 113 | name: '${prefix}-SH-${i+1}-Nic' 114 | location: Location 115 | properties: { 116 | ipConfigurations: [ 117 | { 118 | name: 'name' 119 | properties: { 120 | privateIPAllocationMethod: 'Dynamic' 121 | subnet: { 122 | id: Subnet.id 123 | } 124 | } 125 | } 126 | ] 127 | } 128 | } 129 | ] 130 | 131 | resource VM 'Microsoft.Compute/virtualMachines@2024-07-01' = [ for i in range(0, NumberOfHosts): { 132 | name: '${prefix}-SH-${i+1}' 133 | location: Location 134 | properties: { 135 | hardwareProfile: { 136 | vmSize: VMSizes[VMSize].vmSize 137 | } 138 | securityProfile: { 139 | securityType: 'TrustedLaunch' 140 | uefiSettings: { 141 | secureBootEnabled: true 142 | vTpmEnabled: true 143 | } 144 | } 145 | additionalCapabilities: { 146 | hibernationEnabled: false 147 | } 148 | osProfile: { 149 | computerName: '${prefix}-SH-${i+1}' 150 | adminUsername: AdminUserName 151 | adminPassword: AdminPassword 152 | } 153 | storageProfile: { 154 | imageReference: { 155 | publisher: VMImage[HostOS].publisher 156 | offer: VMImage[HostOS].offer 157 | sku: VMImage[HostOS].sku 158 | version: VMImage[HostOS].version 159 | } 160 | osDisk: { 161 | name: '${prefix}-SH-${i+1}-OSDisk' 162 | caching: 'ReadWrite' 163 | createOption: 'FromImage' 164 | } 165 | } 166 | diagnosticsProfile: { 167 | bootDiagnostics: { 168 | enabled: true 169 | } 170 | } 171 | networkProfile: { 172 | networkInterfaces: [ 173 | { 174 | id: NIC[i].id 175 | } 176 | ] 177 | } 178 | } 179 | } 180 | ] 181 | 182 | resource entraIdJoin 'Microsoft.Compute/virtualMachines/extensions@2024-03-01' = [ for i in range(0, NumberOfHosts):{ 183 | parent: VM[i] 184 | name: 'AADLoginForWindows' 185 | location: Location 186 | properties: { 187 | publisher: 'Microsoft.Azure.ActiveDirectory' 188 | type: 'AADLoginForWindows' 189 | typeHandlerVersion: '1.0' 190 | autoUpgradeMinorVersion: true 191 | enableAutomaticUpgrade: false 192 | } 193 | } 194 | ] 195 | 196 | resource AVDDsc 'Microsoft.Compute/virtualMachines/extensions@2024-07-01' = [ for i in range(0, NumberOfHosts):{ 197 | parent: VM[i] 198 | name: 'MicrosoftPowershellDSC' 199 | location: Location 200 | properties: { 201 | publisher: 'Microsoft.Powershell' 202 | type: 'DSC' 203 | typeHandlerVersion: '2.9' 204 | autoUpgradeMinorVersion: true 205 | settings: { 206 | modulesUrl: modulesUrl 207 | configurationFunction: 'Configuration.ps1\\AddSessionHost' 208 | properties: { 209 | hostPoolName: HostPool.name 210 | aadJoin: true 211 | } 212 | } 213 | protectedSettings: { 214 | properties: { 215 | registrationInfoToken: HostPool.listRegistrationTokens().value[0].token 216 | } 217 | } 218 | } 219 | dependsOn: [ 220 | entraIdJoin 221 | ] 222 | } 223 | ] 224 | 225 | -------------------------------------------------------------------------------- /AVD--Bicep/test.excalidraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/AVD--Bicep/test.excalidraw.png -------------------------------------------------------------------------------- /AZ-140 WVD FastHack Scenario.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/AZ-140 WVD FastHack Scenario.docx -------------------------------------------------------------------------------- /AZ-140-NetworkHubBuild.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Domain": { 6 | "type": "string" 7 | }, 8 | "Environment": { 9 | "type": "string", 10 | "metadata": { 11 | "description": "Determines the environment of the resource (e.g., 'd' for Development)" 12 | }, 13 | "defaultValue": "d" 14 | }, 15 | "Location": { 16 | "type": "string", 17 | "metadata": { 18 | "description": "Location is used to specify the deployment location for each Resource" 19 | }, 20 | "defaultValue": "eastus" 21 | }, 22 | "LocationAbbr": { 23 | "type": "string", 24 | "metadata": { 25 | "description": "Location Abbreviation is used to name Resources" 26 | }, 27 | "defaultValue": "eus" 28 | }, 29 | "Timestamp": { 30 | "type": "string", 31 | "defaultValue": "[utcNow()]" 32 | }, 33 | "VmPassword": { 34 | "type": "securestring", 35 | "metadata": { 36 | "description": "Password used for the Local Administrator, Domain Administrator, and User accounts" 37 | } 38 | }, 39 | "VmUsername": { 40 | "type": "string", 41 | "metadata": { 42 | "description": "Local Adminstrator Username for the Domain Controllers" 43 | } 44 | } 45 | }, 46 | "variables": { 47 | "IpAddresses": [ 48 | "10.0.0.196", 49 | "10.0.0.197" 50 | ] 51 | }, 52 | "resources": [ 53 | { 54 | "comments": "---------- LINKED DEPLOYMENT > NETWORK ----------", 55 | "type": "Microsoft.Resources/deployments", 56 | "name": "[concat('Network_',parameters('Timestamp'))]", 57 | "apiVersion": "2019-10-01", 58 | "resourceGroup": "[concat('rg-wth-network-', parameters('Environment'),'-', parameters('LocationAbbr'))]", 59 | "properties": { 60 | "expressionEvaluationOptions": { 61 | "scope": "inner" 62 | }, 63 | "mode": "Incremental", 64 | "parameters": { 65 | "Environment": { 66 | "value": "[parameters('Environment')]" 67 | }, 68 | "IpAddresses": { 69 | "value": "[variables('IpAddresses')]" 70 | }, 71 | "Location": { 72 | "value": "[parameters('Location')]" 73 | }, 74 | "LocationAbbr": { 75 | "value": "[parameters('LocationAbbr')]" 76 | } 77 | }, 78 | "templateLink": { 79 | "uri": "https://raw.githubusercontent.com/jamasten/WhatTheHack/main/templates/challenge-02_network.json" 80 | } 81 | } 82 | }, 83 | { 84 | "comments": "---------- LINKED DEPLOYMENT > IDENTITY ----------", 85 | "type": "Microsoft.Resources/deployments", 86 | "name": "[concat('Identity_',parameters('Timestamp'))]", 87 | "apiVersion": "2019-10-01", 88 | "dependsOn": [ 89 | "[concat('Network_', parameters('Timestamp'))]" 90 | ], 91 | "resourceGroup": "[concat('rg-wth-identity-', parameters('Environment'),'-', parameters('LocationAbbr'))]", 92 | "properties": { 93 | "expressionEvaluationOptions": { 94 | "scope": "inner" 95 | }, 96 | "mode": "Incremental", 97 | "parameters": { 98 | "Domain": { 99 | "value": "[parameters('Domain')]" 100 | }, 101 | "Environment": { 102 | "value": "[parameters('Environment')]" 103 | }, 104 | "IpAddresses": { 105 | "value": "[variables('IpAddresses')]" 106 | }, 107 | "Location": { 108 | "value": "[parameters('Location')]" 109 | }, 110 | "LocationAbbr": { 111 | "value": "[parameters('LocationAbbr')]" 112 | }, 113 | "Timestamp": { 114 | "value": "[parameters('Timestamp')]" 115 | }, 116 | "VmPassword": { 117 | "value": "[parameters('VmPassword')]" 118 | }, 119 | "VmUsername": { 120 | "value": "[parameters('VmUsername')]" 121 | } 122 | }, 123 | "templateLink": { 124 | "uri": "https://raw.githubusercontent.com/jamasten/WhatTheHack/main/templates/challenge-02_identity.json" 125 | } 126 | } 127 | } 128 | ], 129 | "outputs": {} 130 | } 131 | -------------------------------------------------------------------------------- /AZ-140-RGBuild.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "ResourceGroups": { 6 | "type": "array", 7 | "metadata": { 8 | "description": "Resource group identifier" 9 | }, 10 | "defaultValue": [ 11 | { 12 | "Name":"rg-wth-identity-d-eus", 13 | "Location":"eastus" 14 | }, 15 | { 16 | "Name":"rg-wth-network-d-eus", 17 | "Location":"eastus" 18 | }, 19 | { 20 | "Name":"rg-wth-wvd-d-eus", 21 | "Location":"eastus" 22 | }, 23 | { 24 | "Name":"rg-wth-wvd-d-jw", 25 | "Location":"japanwest" 26 | }, 27 | { 28 | "Name":"rg-wth-wvd-d-uks", 29 | "Location":"uksouth" 30 | } 31 | ] 32 | } 33 | }, 34 | "resources": [ 35 | { 36 | "comments": "---------- RESOURCE GROUPS ----------", 37 | "name": "[parameters('ResourceGroups')[copyIndex()].Name]", 38 | "type": "Microsoft.Resources/resourceGroups", 39 | "apiVersion": "2019-10-01", 40 | "location": "[parameters('ResourceGroups')[copyIndex()].Location]", 41 | "tags": {}, 42 | "properties": {}, 43 | "copy": { 44 | "name": "rgLoop", 45 | "count": "[length(parameters('ResourceGroups'))]" 46 | } 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /PowerShell/0_AppAttach - Template.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 10-23-2023 3 | # Usage : Azure Virtual Desktop App Attach - Create App Images 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 10/23/2023 1.0 Initial Version 9 | # 10 | #********************************************************************************* 11 | # 12 | #> 13 | 14 | ##################################### 15 | # MSIX App Attach - Variables # 16 | ##################################### 17 | $App = '' 18 | $MSIXPackageName = '' 19 | $MSIXPath = 'C:\temp\AVD App Attach\MSIX Packages\' 20 | $PackagePath = "$MSIXPath$MSIXPackageName" 21 | $CimDestinationPath = "C:\temp\AVD App Attach\AppAttach\$App\$App.cim" 22 | $VhdxDestinationPath = "C:\temp\AVD App Attach\AppAttach\$App\$App.vhdx" 23 | 24 | 25 | ############################## 26 | # Create Cim Directory # 27 | ############################## 28 | $CimDirectory = "C:\temp\AVD App Attach\AppAttach\$App" 29 | if ((Test-Path -path $CimDirectory) -ne $True) { 30 | New-Item -ItemType Directory $CimDirectory 31 | } 32 | 33 | ######################################## 34 | # MSIX App Attach - CIMfs Format # 35 | ######################################## 36 | & 'C:\temp\AVD App Attach\MSIXMgr\msixmgr.exe' ` 37 | -Unpack ` 38 | -packagePath $PackagePath ` 39 | -destination $CimDestinationPath ` 40 | -applyACLs ` 41 | -create ` 42 | -fileType cim ` 43 | -rootDirectory apps 44 | 45 | 46 | ####################################### 47 | # MSIX App Attach - VHDX Format # 48 | ####################################### 49 | & 'C:\temp\AVD App Attach\MSIXMgr\msixmgr.exe' ` 50 | -Unpack ` 51 | -packagePath $PackagePath ` 52 | -destination $VhdxDestinationPath ` 53 | -applyACLs ` 54 | -create ` 55 | -fileType vhdx ` 56 | -rootDirectory apps 57 | 58 | 59 | -------------------------------------------------------------------------------- /PowerShell/15-AZ-140 - CLI.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | az desktopvirtualization hostpool create ` 4 | --resource-group "rg-wth-wvd-d-eus" ` 5 | --name "hp-wth-wvd-d-eus" ` 6 | --location "eastus" ` 7 | --host-pool-type "Pooled" ` 8 | --load-balancer-type "BreadthFirst" ` 9 | --max-session-limit 10 ` 10 | --description "US General Users" ` 11 | --friendly-name "US Pool" ` 12 | --personal-desktop-assignment-type "Automatic" ` 13 | --registration-info expiration-time="2021-05-01T14:01:54.9571247Z" registration-token-operation="Update" ` 14 | --tags Application="wvdZeroTo140" costcenter="AZ-140" Environment="Lab" Owner "WVD Admin" SupportContact "x1234" ` 15 | --custom-rdp-property "audiocapturemode:i:1;camerastoredirect:s:*;use multimon:i:0;" 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PowerShell/15-AZ-140 - PowerShell.ps1: -------------------------------------------------------------------------------- 1 | 2 | 3 | New-AzWvdHostPool ` 4 | -ResourceGroupName rg-wth-wvd-d-uks ` 5 | -Name hp-wth-wvd-d-uks ` 6 | -Location 'northeurope' ` 7 | -HostPoolType 'Pooled' ` 8 | -LoadBalancerType 'DepthFirst' ` 9 | -MaxSessionLimit 30 ` 10 | -Description 'Remote Apps Pool for UK' ` 11 | -FriendlyName 'UK South Remote App Pool' ` 12 | -PreferredAppGroupType RailApplications ` 13 | -RegistrationTokenOperation 'Update' ` 14 | -ExpirationTime $((get-date).ToUniversalTime().AddDays(1).ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ')) ` 15 | -Tag @{Application="wvdAZ-140";costcenter="AZ-140";Environment="Lab";Owner="WVD Admin";SupportContact="x1234"} ` 16 | -CustomRdpProperty "audiocapturemode:i:0;camerastoredirect:s:;use multimon:i:0;encode redirected video capture:i:0;audiomode:i:2;redirectclipboard:i:0;redirectprinters:i:0" ` 17 | -ValidationEnvironment:$false 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /PowerShell/AADKerberos.ps1: -------------------------------------------------------------------------------- 1 | ################# 2 | # Prereqs # 3 | ################# 4 | $resourceGroupName = "AADJoin" 5 | $storageAccountName = "avdaadjoineus2" 6 | Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force 7 | Install-Module -Name AzureAD -Force 8 | Install-Module -Name Az.Accounts -Force 9 | Install-Module -Name Az.Storage -Force 10 | Connect-AzureAD 11 | Connect-AzAccount 12 | 13 | 14 | ########################################################### 15 | # Enable Azure AD authentication on storage account # 16 | ########################################################### 17 | $Subscription = $(Get-AzContext).Subscription.Id; 18 | $ApiVersion = '2021-04-01' 19 | $Uri = ('https://management.azure.com/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Storage/storageAccounts/{2}?api-version={3}' -f $Subscription, $ResourceGroupName, $StorageAccountName, $ApiVersion); 20 | $json = 21 | @{properties=@{azureFilesIdentityBasedAuthentication=@{directoryServiceOptions="AADKERB"}}}; 22 | $json = $json | ConvertTo-Json -Depth 99 23 | $token = $(Get-AzAccessToken).Token 24 | $headers = @{ Authorization="Bearer $token" } 25 | try { 26 | Invoke-RestMethod -Uri $Uri -ContentType 'application/json' -Method PATCH -Headers $Headers -Body $json; 27 | } catch { 28 | Write-Host $_.Exception.ToString() 29 | Write-Error -Message "Caught exception setting Storage Account directoryServiceOptions=AADKERB: $_" -ErrorAction Stop 30 | } 31 | 32 | 33 | ####################################################################### 34 | # Generate the kerberos storage account key for storage account # 35 | ####################################################################### 36 | New-AzStorageAccountKey ` 37 | -ResourceGroupName $resourceGroupName ` 38 | -Name $storageAccountName ` 39 | -KeyName kerb1 ` 40 | -ErrorAction Stop 41 | 42 | 43 | ########################################## 44 | # Set the service principal secret # 45 | ########################################## 46 | $kerbKey1 = Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName -ListKerbKey | Where-Object { $_.KeyName -like "kerb1" } 47 | $aadPasswordBuffer = [System.Linq.Enumerable]::Take([System.Convert]::FromBase64String($kerbKey1.Value), 32); 48 | $password = "kk:" + [System.Convert]::ToBase64String($aadPasswordBuffer); 49 | 50 | 51 | ##################################### 52 | # Retrieve tenant information # 53 | ##################################### 54 | $azureAdTenantDetail = Get-AzureADTenantDetail; 55 | $azureAdTenantId = $azureAdTenantDetail.ObjectId 56 | $azureAdPrimaryDomain = ($azureAdTenantDetail.VerifiedDomains | Where-Object {$_._Default -eq $true}).Name 57 | 58 | 59 | ################################################################################# 60 | # Generate the service principal names for the Azure AD service principal # 61 | ################################################################################# 62 | $servicePrincipalNames = New-Object string[] 3 63 | $servicePrincipalNames[0] = 'HTTP/{0}.file.core.windows.net' -f $storageAccountName 64 | $servicePrincipalNames[1] = 'CIFS/{0}.file.core.windows.net' -f $storageAccountName 65 | $servicePrincipalNames[2] = 'HOST/{0}.file.core.windows.net' -f $storageAccountName 66 | 67 | 68 | ####################################################### 69 | # Create an application for the storage account # 70 | ####################################################### 71 | $application = New-AzureADApplication ` 72 | -DisplayName $storageAccountName ` 73 | -IdentifierUris $servicePrincipalNames ` 74 | -GroupMembershipClaims "All"; 75 | 76 | 77 | ############################################################ 78 | # Create a service principal for the storage account # 79 | ############################################################ 80 | $servicePrincipal = New-AzureADServicePrincipal ` 81 | -AccountEnabled $true ` 82 | -AppId $application.AppId ` 83 | -ServicePrincipalType "Application"; 84 | 85 | 86 | ###################################################################### 87 | # Set the password for the storage account's service principal # 88 | ###################################################################### 89 | $Token = ([Microsoft.Open.Azure.AD.CommonLibrary.AzureSession]::AccessTokens['AccessToken']).AccessToken 90 | $apiVersion = '1.6' 91 | $Uri = ('https://graph.windows.net/{0}/{1}/{2}?api-version={3}' -f $azureAdPrimaryDomain, 'servicePrincipals', $servicePrincipal.ObjectId, $apiVersion) 92 | $json = @' 93 | { 94 | "passwordCredentials": [ 95 | { 96 | "customKeyIdentifier": null, 97 | "endDate": "", 98 | "value": "", 99 | "startDate": "" 100 | }] 101 | } 102 | '@ 103 | $now = [DateTime]::UtcNow 104 | $json = $json -replace "", $now.AddDays(-1).ToString("s") 105 | $json = $json -replace "", $now.AddMonths(12).ToString("s") 106 | $json = $json -replace "", $password 107 | $Headers = @{'authorization' = "Bearer $($Token)"} 108 | try { 109 | Invoke-RestMethod -Uri $Uri -ContentType 'application/json' -Method Patch -Headers $Headers -Body $json 110 | Write-Host "Success: Password is set for $storageAccountName" 111 | } catch { 112 | Write-Host $_.Exception.ToString() 113 | Write-Host "StatusCode: " $_.Exception.Response.StatusCode.value 114 | Write-Host "StatusDescription: " $_.Exception.Response.StatusDescription 115 | } 116 | -------------------------------------------------------------------------------- /PowerShell/ADFS/ADFS Customizations.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/PowerShell/ADFS/ADFS Customizations.ps1 -------------------------------------------------------------------------------- /PowerShell/ADFS/ADFS SSO.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/PowerShell/ADFS/ADFS SSO.ps1 -------------------------------------------------------------------------------- /PowerShell/Configure WVD.ps1: -------------------------------------------------------------------------------- 1 |  2 | <# 3 | .Synopsis 4 | Prepare to deploy Windows Virtual Desktop Environment 5 | 6 | .Description 7 | Install WVD PowerShell Modules, 8 | Create WVD Resourceses: 9 | WVD Tenant, 10 | HostPool, 11 | WVD Permissions, 12 | First App Group, 13 | App Group Permissions 14 | 15 | .Parameter AADTenantID 16 | Azure Active Directory Tenant ID 17 | AAD Portal, Properties Copy ID 18 | 19 | .Parameter SubscriptionID 20 | Azure Subscription ID 21 | 22 | .Parameter AzureADGlobalAdmin 23 | Azure AD Global Admin user name 24 | 25 | .Parameter AzureADDomainName 26 | Azure AD Domain Name, i.e. MSAzureAcademy.com 27 | 28 | .Parameter WVDTenantName 29 | Name of the Windows Virtual Desktop Tenant 30 | 31 | .Parameter WVDTenantGroup 32 | Tenant Group name, by default the first group is called '' 33 | 34 | .Parameter WVDHostPoolName 35 | Name of the Windows Virtual Desktop Host Pool 36 | 37 | .Parameter FirstAppGroupName 38 | Enter the name of the App Group for your Remote Applications 39 | 40 | .Example 41 | # Create new Windows Virtual Desktop Deployment 42 | New-AzureWVDPrep ` 43 | -AADTenantID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ` 44 | -SubscriptionID 00000000-0000-0000-0000-000000000000 ` 45 | -AzureADGlobalAdmin WVDAdmin ` 46 | -AzureADDomainName MSAzureAcademy.com ` 47 | -WVDTenantName MSAA-Tenant ` 48 | -WVDTenantGroup 'Default Tenant Group' ` 49 | -WVDHostPoolName MSAA-HostPool 50 | 51 | #> 52 | 53 | 54 | ########################### 55 | # General Variables # 56 | ########################### 57 | $AADTenantID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' 58 | $SubscriptionID = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy' 59 | $WVDTenantName = 'MSAA-Tenant' 60 | $WVDTenantGroup = 'Default Tenant Group' 61 | $WVDHostPoolName = 'MSAA-HostPool' 62 | $FirstAppGroupName = 'MSAA-WVD' 63 | $AzureADGlobalAdmin = 'WVD' 64 | $AzureADDomainName = 'MSAzureAcademy.com' 65 | $FQDN = "$AzureADGlobalAdmin@$AzureADDomainName" 66 | 67 | 68 | ########################################### 69 | # Install PowerShell Module for WVD # 70 | ########################################### 71 | $Module = 'Microsoft.RDInfra.RDPowerShell' 72 | if((Test-Path -Path "C:\Program Files\WindowsPowerShell\Modules\$Module" -ErrorAction SilentlyContinue)-eq $true) { 73 | if((Get-Module -Name $Module -ErrorAction SilentlyContinue) -eq $false) { 74 | Write-Host ` 75 | -ForegroundColor Cyan ` 76 | -BackgroundColor Black ` 77 | "Importing Module" 78 | Import-Module -Name $Module -Verbose -ErrorAction SilentlyContinue 79 | 80 | } 81 | Else { 82 | Write-Host ` 83 | -ForegroundColor Yellow ` 84 | -BackgroundColor Black ` 85 | "Module already imported" 86 | } 87 | } 88 | else { 89 | Install-Module -Name $Module -Force -Verbose -ErrorAction Stop 90 | } 91 | Add-RdsAccount ` 92 | -DeploymentUrl “https://rdbroker.wvd.microsoft.com” 93 | 94 | 95 | ############################### 96 | # Create New WVD Tenant # 97 | ############################### 98 | New-RDSTenant ` 99 | -Name $WVDTenantName ` 100 | -AadTenantId $AADTenantID ` 101 | -AzureSubscriptionId $SubscriptionID 102 | New-RdsHostPool ` 103 | -TenantName $WVDTenantName ` 104 | -Name $WVDHostPoolName ` 105 | -FriendlyName $WVDHostPoolName 106 | New-RdsRoleAssignment ` 107 | -RoleDefinitionName 'RDS Owner' ` 108 | -SignInName $FQDN ` 109 | -TenantGroupName $WVDTenantGroup ` 110 | -TenantName $WVDTenantName ` 111 | -HostPoolName $WVDHostPoolName ` 112 | -AADTenantId $AADTenantID ` 113 | -AppGroupName 'Desktop Application Group' ` 114 | -Verbose 115 | 116 | 117 | ####################################### 118 | # Create New Application Groups # 119 | ####################################### 120 | New-RdsAppGroup ` 121 | -TenantName $WVDTenantName ` 122 | -HostPoolName $WVDHostPoolName ` 123 | -Name $FirstAppGroupName ` 124 | -ResourceType RemoteApp ` 125 | -Verbose 126 | Add-RdsAppGroupUser ` 127 | -TenantName $WVDTenantName ` 128 | -HostPoolName $WVDHostPoolName ` 129 | -UserPrincipalName $FQDN ` 130 | -AppGroupName $FirstAppGroupName 131 | 132 | 133 | 134 | 135 | 136 | ####################### 137 | # Setup WVD Apps # 138 | ####################### 139 | $RemoteApps = @( 140 | @{AppGroupName = 'MSAA-WVD'; FilePath = '7zFM.exe'} 141 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'Calc.exe'} 142 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'Code.exe'} 143 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'FoxITReader.exe'} 144 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'HandBrake.exe'} 145 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'Paint.net'} 146 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'Putty.exe'} 147 | @{AppGroupName = 'MSAA-WVD'; FilePath = 'WinRar'} 148 | ) 149 | foreach ($App in $RemoteApps) { 150 | Get-RdsStartMenuApp ` 151 | -TenantName $WVDTenantName ` 152 | -HostPoolName $WVDHostPoolName ` 153 | -AppGroupName $App.AppGroupName ` 154 | | ? FilePath -Match $App.FilePath ` 155 | -OutVariable NewApp 156 | 157 | New-RdsRemoteApp ` 158 | -TenantName $WVDTenantName ` 159 | -HostPoolName $WVDHostPoolName ` 160 | -AppGroupName $App.AppGroupName ` 161 | -Name $NewApp.FriendlyName ` 162 | -Filepath $NewApp.filepath ` 163 | -IconPath $NewApp.iconpath ` 164 | -IconIndex $NewApp.iconindex 165 | } 166 | 167 | 168 | ###################### 169 | # WVD Clean Up # 170 | ###################### 171 | Function Remove-AzureWVD { 172 | <# 173 | .Synopsis 174 | Clean up and remove WVD 175 | 176 | .Description 177 | Remove in order 178 | Applications, 179 | App users, 180 | App Group, 181 | Session Hosts, 182 | Host Pools 183 | Tenant 184 | 185 | .Parameter WVDTenantName 186 | Name of the Windows Virtual Desktop Tenant 187 | 188 | .Parameter WVDHostPoolName 189 | Name of the Windows Virtual Desktop Host Pool 190 | 191 | .Example 192 | # Clean up WVD 193 | Remove-AzureWVD ` 194 | -WVDTenantName MSAA-Tenant ` 195 | -WVDHostPoolName MSAA-HostPool 196 | 197 | #> 198 | [Cmdletbinding()] 199 | Param ( 200 | [Parameter(Mandatory=$true)] 201 | [string]$WVDTenantName, 202 | [Parameter(Mandatory=$true)] 203 | [string]$WVDHostPoolName 204 | ) 205 | 206 | Begin { 207 | Write-Host ` 208 | -ForegroundColor Magenta ` 209 | -BackgroundColor Black ` 210 | "Preparing to DELETE WVD in 5 Seconds" 211 | Wait-Event -Timeout 2 212 | Write-Host -ForegroundColor Red -BackgroundColor Black "5" 213 | Wait-Event -Timeout 1 214 | Write-Host -ForegroundColor Red -BackgroundColor Black "4" 215 | Wait-Event -Timeout 1 216 | Write-Host -ForegroundColor Red -BackgroundColor Black "3" 217 | Wait-Event -Timeout 1 218 | Write-Host -ForegroundColor Red -BackgroundColor Black "2" 219 | Wait-Event -Timeout 1 220 | Write-Host -ForegroundColor Red -BackgroundColor Black "1" 221 | Wait-Event -Timeout 1 222 | Write-Host -ForegroundColor Red -BackgroundColor Black "Now Removing WVD..." 223 | } 224 | 225 | Process { 226 | $AppGroup = Get-RdsAppGroup ` 227 | -TenantName $WVDTenantName ` 228 | -HostPoolName $WVDHostPoolName ` 229 | | ? -Property AppGroupName ` 230 | -NE 'Desktop Application Group' ` 231 | -ErrorAction SilentlyContinue 232 | foreach ($APG in $AppGroup) { 233 | Get-RdsRemoteApp ` 234 | -TenantName $WVDTenantName ` 235 | -HostPoolName $WVDHostPoolName ` 236 | -AppGroupName $APG.AppGroupName ` 237 | | Remove-RdsRemoteApp 238 | Get-RdsAppGroupUser ` 239 | -TenantName $WVDTenantName ` 240 | -HostPoolName $WVDHostPoolName ` 241 | -AppGroupName $APG.AppGroupName ` 242 | | Remove-RdsAppGroupUser 243 | $APG | Remove-RdsAppGroup 244 | Remove-RdsAppGroup ` 245 | -TenantName $WVDTenantName ` 246 | -HostPoolName $WVDHostPoolName ` 247 | -Name 'Desktop Application Group' 248 | } 249 | Get-RdsSessionHost ` 250 | -TenantName $WVDTenantName ` 251 | -HostPoolName $WVDHostPoolName ` 252 | -ErrorAction SilentlyContinue ` 253 | | Remove-RdsSessionHost 254 | Get-RdsHostPool ` 255 | -TenantName $WVDTenantName ` 256 | -ErrorAction SilentlyContinue ` 257 | | Remove-RdsHostPool 258 | Get-RdsTenant ` 259 | -Name $WVDTenantName ` 260 | -ErrorAction SilentlyContinue ` 261 | | Remove-RdsTenant 262 | 263 | } 264 | 265 | End { 266 | Write-Host "Tenant " -NoNewline; ` 267 | Write-Host $WVDTenantName -ForegroundColor Red -NoNewline; ` 268 | Write-Host " has been removed" -NoNewline; 269 | 270 | } 271 | 272 | } 273 | 274 | <# 275 | Remove-AzureWVD ` 276 | -WVDTenantName $WVDTenantName ` 277 | -WVDHostPoolName $WVDHostPoolName ` 278 | -Verbose 279 | 280 | #> 281 | 282 | -------------------------------------------------------------------------------- /PowerShell/Ephemeral-Sizes.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | param([Parameter(Mandatory=$true)] 3 | [ValidateNotNullOrEmpty()] 4 | [string]$Location, 5 | [Parameter(Mandatory=$true)] 6 | [long]$OSImageSizeInGB 7 | ) 8 | 9 | Function HasSupportEphemeralOSDisk([object[]] $capability) 10 | { 11 | return $capability | where { $_.Name -eq "EphemeralOSDiskSupported" -and $_.Value -eq "True"} 12 | } 13 | 14 | Function Get-MaxTempDiskAndCacheSize([object[]] $capabilities) 15 | { 16 | $MaxResourceVolumeGB = 0; 17 | $CachedDiskGB = 0; 18 | $NvmeDiskGB = 0; 19 | 20 | foreach($capability in $capabilities) 21 | { 22 | if ($capability.Name -eq "MaxResourceVolumeMB") 23 | { $MaxResourceVolumeGB = [int]($capability.Value / 1024) } 24 | 25 | if ($capability.Name -eq "CachedDiskBytes") 26 | { $CachedDiskGB = [int]($capability.Value / (1024 * 1024 * 1024)) } 27 | 28 | if ($capability.Name -eq "NvmeDiskSizeInMiB") 29 | { $NvmeDiskGB = [int]($capability.Value / (1024)) } 30 | 31 | if ($capability.Name -eq "SupportedEphemeralOSDiskPlacements") 32 | { $NvmeSupported = [bool]($capability.Value -contains "NvmeDisk") } 33 | 34 | } 35 | 36 | if (!$NvmeSupported) 37 | { $NvmeDiskGB = 0; } 38 | return ($MaxResourceVolumeGB, $CachedDiskGB, $NvmeDiskGB) 39 | } 40 | 41 | Function Get-EphemeralSupportedVMSku 42 | { 43 | [CmdletBinding()] 44 | Param 45 | ( 46 | [Parameter(Mandatory=$true)] 47 | [long]$OSImageSizeInGB, 48 | [Parameter(Mandatory=$true)] 49 | [string]$Location 50 | ) 51 | 52 | $VmSkus = Get-AzComputeResourceSku $Location | Where-Object { $_.ResourceType -eq "virtualMachines" -and (HasSupportEphemeralOSDisk $_.Capabilities) -ne $null } 53 | 54 | $Response = @() 55 | foreach ($sku in $VmSkus) 56 | { 57 | ($MaxResourceVolumeGB, $CachedDiskGB, $NvmeDiskGB) = Get-MaxTempDiskAndCacheSize $sku.Capabilities 58 | 59 | $Response += New-Object PSObject -Property @{ 60 | ResourceSKU = $sku.Size 61 | NvmeDiskPlacement = @{ $true = "NOT SUPPORTED"; $false = "SUPPORTED"}[$NvmeDiskGB -lt $OSImageSizeInGB] 62 | TempDiskPlacement = @{ $true = "NOT SUPPORTED"; $false = "SUPPORTED"}[$MaxResourceVolumeGB -lt $OSImageSizeInGB] 63 | CacheDiskPlacement = @{ $true = "NOT SUPPORTED"; $false = "SUPPORTED"}[$CachedDiskGB -lt $OSImageSizeInGB] 64 | }; 65 | } 66 | 67 | return $Response 68 | } 69 | 70 | Get-EphemeralSupportedVMSku -OSImageSizeInGB $OSImageSizeInGB -Location $Location | Format-Table -------------------------------------------------------------------------------- /PowerShell/FSLogix100Cloud CloudCache.ps1: -------------------------------------------------------------------------------- 1 | write-host "Configuring FSLogix" 2 | 3 | 4 | ################### 5 | # Variables # 6 | ################### 7 | $fileServer=".file.core.windows.net" 8 | $user="localhost\" 9 | $profileShare="\\$($fileServer)\" 10 | $secret="" 11 | $CloudCache="type=smb,connectionstring=$profileShare" 12 | 13 | 14 | ########################################### 15 | # Execute Command In SYSTEM Context # 16 | ########################################### 17 | New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LsaCfgFlags" -Value 0 -force 18 | cmd.exe /c "cmdkey.exe /add:$fileServer /user:$($user) /pass:$($secret)" 19 | 20 | 21 | ################ 22 | # Profile # 23 | ################ 24 | New-Item -Path "HKLM:\SOFTWARE" -Name "FSLogix" -ErrorAction Ignore 25 | New-Item -Path "HKLM:\SOFTWARE\FSLogix" -Name "Profiles" -ErrorAction Ignore 26 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "CCDLocations" -Value $CloudCache -force 27 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "Enabled" -Value 1 -force 28 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ClearCacheOnLogoff" -Value 1 -force 29 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "FlipFlopProfileDirectoryName" -Value 1 -force 30 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "DeleteLocalProfileWhenVHDShouldApply" -Value 1 -force 31 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "HealthyProvidersRequiredForRegister" -Value "1" -force 32 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "LockedRetryCount" -Value "3" -force 33 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "LockedRetryInterval" -Value "15" -force 34 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ReAttachRetryCount" -Value "3" -force 35 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ReAttachIntervalSeconds" -Value "15" -force 36 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ProfileType" -Value 0 -force 37 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "SizeInMBs" -Value 30000 -force 38 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "VolumeType" -Value "VHDX" -force 39 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "IsDynamic" -Value 1 -force 40 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "AccessNetworkAsComputerObject" -Value "1" -force 41 | 42 | 43 | write-host "Configuration Complete" -------------------------------------------------------------------------------- /PowerShell/FSLogix100Cloud.ps1: -------------------------------------------------------------------------------- 1 | write-host "Configuring FSLogix" 2 | 3 | 4 | ################### 5 | # Variables # 6 | ################### 7 | $fileServer=".file.core.windows.net" 8 | $user="localhost\" 9 | $profileShare="\\$($fileServer)\" 10 | $secret="" 11 | 12 | 13 | ########################################### 14 | # Execute Command In SYSTEM Context # 15 | ########################################### 16 | New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name "LsaCfgFlags" -Value 0 -force 17 | cmd.exe /c "cmdkey.exe /add:$fileServer /user:$($user) /pass:$($secret)" 18 | 19 | 20 | ################ 21 | # Profile # 22 | ################ 23 | New-Item -Path "HKLM:\SOFTWARE" -Name "FSLogix" -ErrorAction Ignore 24 | New-Item -Path "HKLM:\SOFTWARE\FSLogix" -Name "Profiles" -ErrorAction Ignore 25 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "Enabled" -Value 1 -force 26 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "VHDLocations" -Value $profileShare -force 27 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ConcurrentUserSessions" -Value 1 -force 28 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "DeleteLocalProfileWhenVHDShouldApply" -Value 1 -force 29 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "FlipFlopProfileDirectoryName" -Value 1 -force 30 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "IsDynamic" -Value 1 -force 31 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "KeepLocalDir" -Value 0 -force 32 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "ProfileType" -Value 0 -force 33 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "SizeInMBs" -Value 40000 -force 34 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "VolumeType" -Value "VHDX" -force 35 | New-ItemProperty -Path "HKLM:\SOFTWARE\FSLogix\Profiles" -Name "AccessNetworkAsComputerObject" -Value "1" -force 36 | 37 | 38 | write-host "Configuration Complete" -------------------------------------------------------------------------------- /PowerShell/FSLogixSettingsOnly.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 03-12-2021 3 | # Usage : Setup FSLogix 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 03/12/2021 1.0 Intial Version 9 | # 10 | # 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | Param ( 16 | [Parameter(Mandatory=$true)] 17 | [string]$ProfilePath 18 | ) 19 | 20 | ####################################### 21 | # FSLogix User Profile Settings # 22 | ####################################### 23 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Configure FSLogix Profile Settings" 24 | Push-Location 25 | Set-Location HKLM:\SOFTWARE\ 26 | New-Item ` 27 | -Path HKLM:\SOFTWARE\FSLogix ` 28 | -Name Profiles ` 29 | -Value "" ` 30 | -Force 31 | New-Item ` 32 | -Path HKLM:\Software\FSLogix\Profiles\ ` 33 | -Name Apps ` 34 | -Force 35 | Set-ItemProperty ` 36 | -Path HKLM:\Software\FSLogix\Profiles ` 37 | -Name "Enabled" ` 38 | -Type "Dword" ` 39 | -Value "1" 40 | New-ItemProperty ` 41 | -Path HKLM:\Software\FSLogix\Profiles ` 42 | -Name "CCDLocations" ` 43 | -Value "type=smb,connectionString=$ProfilePath" ` 44 | -PropertyType MultiString ` 45 | -Force 46 | Set-ItemProperty ` 47 | -Path HKLM:\Software\FSLogix\Profiles ` 48 | -Name "SizeInMBs" ` 49 | -Type "Dword" ` 50 | -Value "10240" 51 | Set-ItemProperty ` 52 | -Path HKLM:\Software\FSLogix\Profiles ` 53 | -Name "IsDynamic" ` 54 | -Type "Dword" ` 55 | -Value "1" 56 | Set-ItemProperty ` 57 | -Path HKLM:\Software\FSLogix\Profiles ` 58 | -Name "VolumeType" ` 59 | -Type String ` 60 | -Value "vhdx" 61 | Set-ItemProperty ` 62 | -Path HKLM:\Software\FSLogix\Profiles ` 63 | -Name "FlipFlopProfileDirectoryName" ` 64 | -Type "Dword" ` 65 | -Value "1" 66 | Set-ItemProperty ` 67 | -Path HKLM:\Software\FSLogix\Profiles ` 68 | -Name "SIDDirNamePattern" ` 69 | -Type String ` 70 | -Value "%username%%sid%" 71 | Set-ItemProperty ` 72 | -Path HKLM:\Software\FSLogix\Profiles ` 73 | -Name "SIDDirNameMatch" ` 74 | -Type String ` 75 | -Value "%username%%sid%" 76 | Set-ItemProperty ` 77 | -Path HKLM:\Software\FSLogix\Profiles ` 78 | -Name DeleteLocalProfileWhenVHDShouldApply ` 79 | -Type DWord ` 80 | -Value 1 81 | Pop-Location 82 | 83 | 84 | ############# 85 | # END # 86 | ############# 87 | -------------------------------------------------------------------------------- /PowerShell/FSLogixSetup.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 10-15-2020 3 | # Usage : Setup FSLogix 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 10/15/2020 1.0 Intial Version 9 | # 10 | # 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | Param ( 16 | [Parameter(Mandatory=$true)] 17 | [string]$ProfilePath 18 | ) 19 | 20 | ###################### 21 | # WVD Variables # 22 | ###################### 23 | $LocalWVDpath = "c:\temp\wvd\" 24 | $FSLogixURI = 'https://aka.ms/fslogix_download' 25 | $FSInstaller = 'FSLogixAppsSetup.zip' 26 | 27 | 28 | #################################### 29 | # Test/Create Temp Directory # 30 | #################################### 31 | if((Test-Path c:\temp) -eq $false) { 32 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Create C:\temp Directory" 33 | Write-Host ` 34 | -ForegroundColor Cyan ` 35 | -BackgroundColor Black ` 36 | "creating temp directory" 37 | New-Item -Path c:\temp -ItemType Directory 38 | } 39 | else { 40 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "C:\temp Already Exists" 41 | Write-Host ` 42 | -ForegroundColor Yellow ` 43 | -BackgroundColor Black ` 44 | "temp directory already exists" 45 | } 46 | if((Test-Path $LocalWVDpath) -eq $false) { 47 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Create C:\temp\WVD Directory" 48 | Write-Host ` 49 | -ForegroundColor Cyan ` 50 | -BackgroundColor Black ` 51 | "creating c:\temp\wvd directory" 52 | New-Item -Path $LocalWVDpath -ItemType Directory 53 | } 54 | else { 55 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "C:\temp\WVD Already Exists" 56 | Write-Host ` 57 | -ForegroundColor Yellow ` 58 | -BackgroundColor Black ` 59 | "c:\temp\wvd directory already exists" 60 | } 61 | New-Item -Path c:\ -Name New-WVDSessionHost.log -ItemType File 62 | Add-Content ` 63 | -LiteralPath C:\New-WVDSessionHost.log ` 64 | " 65 | ProfilePath = $ProfilePath 66 | RegistrationToken = $RegistrationToken 67 | Optimize = $Optimize 68 | " 69 | 70 | 71 | ################################# 72 | # Download WVD Componants # 73 | ################################# 74 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Downloading FSLogix" 75 | Invoke-WebRequest -Uri $FSLogixURI -OutFile "$LocalWVDpath$FSInstaller" 76 | 77 | 78 | ############################## 79 | # Prep for WVD Install # 80 | ############################## 81 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Unzip FSLogix" 82 | Expand-Archive ` 83 | -LiteralPath "C:\temp\wvd\$FSInstaller" ` 84 | -DestinationPath "$LocalWVDpath\FSLogix" ` 85 | -Force ` 86 | -Verbose 87 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 88 | cd $LocalWVDpath 89 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "UnZip FXLogix Complete" 90 | 91 | 92 | ######################### 93 | # FSLogix Install # 94 | ######################### 95 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Installing FSLogix" 96 | $fslogix_deploy_status = Start-Process ` 97 | -FilePath "$LocalWVDpath\FSLogix\x64\Release\FSLogixAppsSetup.exe" ` 98 | -ArgumentList "/install /quiet" ` 99 | -Wait ` 100 | -Passthru 101 | 102 | 103 | ####################################### 104 | # FSLogix User Profile Settings # 105 | ####################################### 106 | Add-Content -LiteralPath C:\New-WVDSessionHost.log "Configure FSLogix Profile Settings" 107 | Push-Location 108 | Set-Location HKLM:\SOFTWARE\ 109 | New-Item ` 110 | -Path HKLM:\SOFTWARE\FSLogix ` 111 | -Name Profiles ` 112 | -Value "" ` 113 | -Force 114 | New-Item ` 115 | -Path HKLM:\Software\FSLogix\Profiles\ ` 116 | -Name Apps ` 117 | -Force 118 | Set-ItemProperty ` 119 | -Path HKLM:\Software\FSLogix\Profiles ` 120 | -Name "Enabled" ` 121 | -Type "Dword" ` 122 | -Value "1" 123 | New-ItemProperty ` 124 | -Path HKLM:\Software\FSLogix\Profiles ` 125 | -Name "CCDLocations" ` 126 | -Value "type=smb,connectionString=$ProfilePath" ` 127 | -PropertyType MultiString ` 128 | -Force 129 | Set-ItemProperty ` 130 | -Path HKLM:\Software\FSLogix\Profiles ` 131 | -Name "SizeInMBs" ` 132 | -Type "Dword" ` 133 | -Value "30000" 134 | Set-ItemProperty ` 135 | -Path HKLM:\Software\FSLogix\Profiles ` 136 | -Name "IsDynamic" ` 137 | -Type "Dword" ` 138 | -Value "1" 139 | Set-ItemProperty ` 140 | -Path HKLM:\Software\FSLogix\Profiles ` 141 | -Name "VolumeType" ` 142 | -Type String ` 143 | -Value "vhdx" 144 | Set-ItemProperty ` 145 | -Path HKLM:\Software\FSLogix\Profiles ` 146 | -Name "FlipFlopProfileDirectoryName" ` 147 | -Type "Dword" ` 148 | -Value "1" 149 | Set-ItemProperty ` 150 | -Path HKLM:\Software\FSLogix\Profiles ` 151 | -Name "SIDDirNamePattern" ` 152 | -Type String ` 153 | -Value "%username%%sid%" 154 | Set-ItemProperty ` 155 | -Path HKLM:\Software\FSLogix\Profiles ` 156 | -Name "SIDDirNameMatch" ` 157 | -Type String ` 158 | -Value "%username%%sid%" 159 | Set-ItemProperty ` 160 | -Path HKLM:\Software\FSLogix\Profiles ` 161 | -Name DeleteLocalProfileWhenVHDShouldApply ` 162 | -Type DWord ` 163 | -Value 1 164 | Pop-Location 165 | 166 | 167 | ############# 168 | # END # 169 | ############# 170 | -------------------------------------------------------------------------------- /PowerShell/MSIX App Attach Migration.ps1: -------------------------------------------------------------------------------- 1 | ######################################## 2 | # 1 MSIX to App Attach Migration # 3 | ######################################## 4 | $parameters = @{ 5 | HostPoolName = '' 6 | ResourceGroupName = '' 7 | } 8 | 9 | $msixPackage = Get-AzWvdMsixPackage @parameters | ? Name -Match 'MSIX-HP/NotePadPlus_8.5.8.0_x64__gyjvz5nnfka48' 10 | $hostPoolId = (Get-AzWvdHostPool @parameters).Id 11 | 12 | 13 | $parameters = @{ 14 | PermissionSource = 'RAG' 15 | HostPoolsForNewPackage = $hostPoolId 16 | PassThru = $true 17 | } 18 | 19 | $msixPackage | .\Migrate-MsixPackagesToAppAttach.ps1 @parameters 20 | 21 | 22 | 23 | 24 | ########################################## 25 | # All MSIX to App Attach Migration # 26 | ########################################## 27 | $parameters = @{ 28 | HostPoolName = 'MSIX-HP' 29 | ResourceGroupName = 'Cloud-VDI' 30 | } 31 | 32 | $msixPackages = Get-AzWvdMsixPackage @parameters 33 | $hostPoolId = (Get-AzWvdHostPool @parameters).Id 34 | $logFilePath = "$HOME/MsixToAppAttach.log" 35 | 36 | $parameters = @{ 37 | IsActive = $true 38 | DeactivateOrigin = $true 39 | PermissionSource = 'DAG' 40 | HostPoolsForNewPackage = $hostPoolId 41 | PassThru = $true 42 | LogInJSON = $true 43 | LogFilePath = $LogFilePath 44 | } 45 | 46 | $msixPackages | .\Migrate-MsixPackagesToAppAttach.ps1 @parameters -------------------------------------------------------------------------------- /PowerShell/OneDrive for AVD.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 2-05-2020 3 | # Usage : OneDrive for AVD (Pooled) Installation 4 | #******************************************************************************** 5 | # Date Version Changes 6 | #------------------------------------------------------------------------ 7 | # 02/05/2020 1.0 Intial Version 8 | # 02/07/2020 1.1 Add Uninstall 9 | # 04/27/2020 1.2 Add SilentConfig 10 | 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | 16 | ###################### 17 | # Prerequisites # 18 | ###################### 19 | $OneDriveURL = 'https://go.microsoft.com/fwlink/?linkid=844652' 20 | $OutputPath = 'C:\temp\OneDrive\' 21 | $OneDriveEXE = 'OneDriveSetup.exe' 22 | 23 | 24 | ############################# 25 | # Download Setup Files # 26 | ############################# 27 | if((Test-Path $OutputPath) -eq $false) { 28 | write-host ` 29 | -ForegroundColor Red ` 30 | -BackgroundColor Black 'Creating OneDrive Setup Directory' 31 | New-Item -Path $OutputPath -ItemType Directory 32 | Invoke-WebRequest -Uri $OneDriveURL -OutFile $OutputPath$OneDriveEXE 33 | } 34 | else { 35 | write-host ` 36 | -ForegroundColor Cyan ` 37 | -BackgroundColor Black 'Output Directory already exists, Downloading OneDrive' 38 | Invoke-WebRequest -Uri $OneDriveURL -OutFile $OutputPath$OneDriveEXE 39 | } 40 | 41 | 42 | ######################### 43 | # Remove OneDrive # 44 | ######################### 45 | write-host 'Removing OneDrive for clean install' 46 | Start-Process -FilePath "$OutputPath\OneDriveSetup.exe" /uninstall 47 | 48 | ########################## 49 | # Install OneDrive # 50 | ########################## 51 | write-host 'installing OneDrive' 52 | REG ADD "HKLM\Software\Microsoft\OneDrive" /v "AllUsersInstall" /t REG_DWORD /d 1 /reg:64 53 | Start-Process -FilePath "$OutputPath\OneDriveSetup.exe" /allusers 54 | Wait-Event -Timeout 5 55 | write-host 'OneDrive installation complete' 56 | Wait-Event -Timeout 5 57 | write-host 'Configuring OneDrive for AVD' 58 | REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDrive /t REG_SZ /d "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe /background" /f 59 | REG ADD "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /v "SilentAccountConfig" /t REG_DWORD /d 1 /f 60 | REG ADD "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /v "KFMSilentOptIn" /t REG_SZ /d "10c5dfa7-b5c3-4cf2-9265-f0e32a960967" /f 61 | 62 | 63 | -------------------------------------------------------------------------------- /PowerShell/RenameComputer.ps1: -------------------------------------------------------------------------------- 1 | [CmdletBinding()] 2 | [Alias()] 3 | [OutputType([int])] 4 | Param ( 5 | # Param1 help description 6 | [Parameter(Mandatory=$true, 7 | ValueFromPipelineByPropertyName=$true, 8 | Position=0)] 9 | $VMName 10 | ) 11 | 12 | Begin { 13 | #################################### 14 | # Test/Create Temp Directory # 15 | #################################### 16 | if((Test-Path c:\temp) -eq $false) { 17 | Add-Content -LiteralPath C:\RenameComputer.log "Create C:\temp Directory" 18 | Write-Host ` 19 | -ForegroundColor Cyan ` 20 | -BackgroundColor Black ` 21 | "creating temp directory" 22 | New-Item -Path c:\temp -ItemType Directory 23 | } 24 | else { 25 | Add-Content -LiteralPath C:\RenameComputer.log "C:\temp Already Exists" 26 | Write-Host ` 27 | -ForegroundColor Yellow ` 28 | -BackgroundColor Black ` 29 | "temp directory already exists" 30 | } 31 | New-Item -Path c:\ -Name C:\RenameComputer.log -ItemType File 32 | Add-Content -LiteralPath C:\RenameComputer.log ` 33 | " 34 | CurrentName = $env:COMPUTERNAME 35 | TargetName = $VMName 36 | " 37 | 38 | } 39 | 40 | Process { 41 | Add-Content -LiteralPath C:\RenameComputer.log "Current ComputerName = $env:COMPUTERNAME, Rename Target = $VMName" 42 | Rename-Computer -NewName $VMName -Restart -Verbose 43 | } 44 | 45 | End 46 | { 47 | 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /PowerShell/Teams-AVRedirection: -------------------------------------------------------------------------------- 1 | # set regKey 2 | write-host 'AIB Customization: Set required regKey' 3 | New-Item -Path HKLM:\SOFTWARE\Microsoft -Name "Teams" 4 | New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Teams -Name "IsWVDEnvironment" -Type "Dword" -Value "1" 5 | write-host 'AIB Customization: Finished Set required regKey' 6 | 7 | 8 | # install vc 9 | write-host 'AIB Customization: Install the latest Microsoft Visual C++ Redistributable' 10 | $appName = 'teams' 11 | $drive = 'C:\' 12 | New-Item -Path $drive -Name $appName -ItemType Directory -ErrorAction SilentlyContinue 13 | $LocalPath = $drive + '\' + $appName 14 | set-Location $LocalPath 15 | $visCplusURL = 'https://aka.ms/vs/16/release/vc_redist.x64.exe' 16 | $visCplusURLexe = 'vc_redist.x64.exe' 17 | $outputPath = $LocalPath + '\' + $visCplusURLexe 18 | Invoke-WebRequest -Uri $visCplusURL -OutFile $outputPath 19 | write-host 'AIB Customization: Starting Install the latest Microsoft Visual C++ Redistributable' 20 | Start-Process -FilePath $outputPath -Args "/install /quiet /norestart /log vcdist.log" -Wait 21 | write-host 'AIB Customization: Finished Install the latest Microsoft Visual C++ Redistributable' 22 | 23 | 24 | # install webSoc svc 25 | write-host 'AIB Customization: Install the Teams WebSocket Service' 26 | $webSocketsURL = 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RE4AQBt' 27 | $webSocketsInstallerMsi = 'webSocketSvc.msi' 28 | $outputPath = $LocalPath + '\' + $webSocketsInstallerMsi 29 | Invoke-WebRequest -Uri $webSocketsURL -OutFile $outputPath 30 | Start-Process -FilePath msiexec.exe -Args "/I $outputPath /quiet /norestart /log webSocket.log" -Wait 31 | write-host 'AIB Customization: Finished Install the Teams WebSocket Service' 32 | 33 | # install Teams 34 | write-host 'AIB Customization: Install MS Teams' 35 | $teamsURL = 'https://teams.microsoft.com/downloads/desktopurl?env=production&plat=windows&arch=x64&managedInstaller=true&download=true' 36 | $teamsMsi = 'teams.msi' 37 | $outputPath = $LocalPath + '\' + $teamsMsi 38 | Invoke-WebRequest -Uri $teamsURL -OutFile $outputPath 39 | Start-Process -FilePath msiexec.exe -Args "/I $outputPath /quiet /norestart /log teams.log ALLUSER=1 ALLUSERS=1" -Wait 40 | write-host 'AIB Customization: Finished Install MS Teams' 41 | 42 | 43 | -------------------------------------------------------------------------------- /PowerShell/WVD - Diag Setup.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 08-15-2019 3 | # Usage : Windows Virtual Desktop Diagnostics Tool 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 08/15/2019 1.0 Intial Version 9 | # 10 | # 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | 16 | ####################### 17 | # WVD Variables # 18 | ####################### 19 | $TenantName = 'AzureAcademy-Tenant' 20 | 21 | 22 | ################################ 23 | # WVD Diags--The old way # 24 | ################################ 25 | Get-RdsDiagnosticActivities ` 26 | -TenantName $TenantName ` 27 | -StartTime 8/10/2019 ` 28 | -EndTime 8/11/2019 ` 29 | | Sort-Object -Property ActivityType, UserName ` 30 | |ft -AutoSize 31 | 32 | Get-RdsDiagnosticActivities ` 33 | -TenantName $TenantName ` 34 | -ActivityId 2aa93ef8-d33f-4b0c-aaa5-e160014f0000 35 | 36 | 37 | ################################ 38 | # Setup WVD Diag Scripts # 39 | ################################ 40 | & 'C:\temp\Create AD App Registration for Diagnostics.ps1' 41 | & 'C:\temp\Create LogAnalyticsWorkspace for Diagnostics.ps1' 42 | 43 | 44 | ################################## 45 | # WVD Diag Prereqs Outputs # 46 | ################################## 47 | # Service Principal Name: AA--WVD--Diags 48 | # Log Analytics workspace Name: AA-WVD-LogAnalytics-00 49 | # 50 | # Client Id : dd93276a-a17a-4377-ba9e-b7e42fd15ac4 51 | # Client Secret Key: N2JmYWZmMmUtNGY1Ni00OWQzLTk5ZGYtZDc3YTNkY2M1YTEz= 52 | # Log Analytics workspace Id: 2fa4da7e-dcb5-4040-8fd5-b850019da872 53 | 54 | 55 | -------------------------------------------------------------------------------- /PowerShell/WVD-Scaling-Automation.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 12-15-2019 3 | # Usage : Windows Virtual Desktop Scaling Script Setup 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 12/15/2019 1.0 Intial Version 9 | # 02/07/2020 1.1 Add more variables for all data 10 | # 02/27/2020 1.2 Clean up variables for public use 11 | # 03/17/2020 1.3 fix mismatched variables 12 | #********************************************************************************* 13 | # 14 | #> 15 | 16 | 17 | ########################### 18 | # General Variables # 19 | ########################### 20 | $AADTenantID = '' 21 | $SubscriptionID = '' 22 | $TenantName = '' 23 | $HostPoolName = '' 24 | $ResourceGroupName = '' 25 | $RecurrenceInterval = 15 26 | $BeginPeakTime = '9:00' 27 | $EndPeakTime = '18:00' 28 | $TimeDifference = '+5:00' 29 | $SessionThresholdPerCPU= 2 30 | $MinimumNumberOfRdsh = 1 31 | $LimitSecondsToForceLogOffUser = 30 32 | $LogOffMessageTitle = '' 33 | $LogOffMessageBody = '' 34 | $Location = '' 35 | $AutomationAccountName = '' 36 | $ConnectionAssetName = '' 37 | $MaintenanceTagName = '' 38 | $WorkspaceName = '' 39 | $Workspace = Get-AzOperationalInsightsWorkspace | Where-Object { $_.Name -eq $WorkspaceName } 40 | $WorkspaceID = ($Workspace).CustomerId.guid 41 | $WorkspaceKey = (Get-AzOperationalInsightsWorkspaceSharedKey -ResourceGroupName $Workspace.ResourceGroupName -Name $WorkspaceName).PrimarySharedKey 42 | $LocalPath = '' 43 | cd $LocalPath 44 | 45 | 46 | ########################################## 47 | # Download Scripts for WVD Scaling # 48 | ########################################## 49 | Invoke-WebRequest ` 50 | -Uri "https://raw.githubusercontent.com/Azure/RDS-Templates/master/wvd-templates/wvd-scaling-script/CreateOrUpdateAzAutoAccount.ps1" ` 51 | -OutFile "$LocalPath\createazureautomationaccount.ps1" 52 | Invoke-WebRequest ` 53 | -Uri "https://raw.githubusercontent.com/Azure/RDS-Templates/master/wvd-templates/wvd-scaling-script/CreateOrUpdateAzLogicApp.ps1" ` 54 | -OutFile "$LocalPath\createazurelogicapp.ps1" 55 | 56 | 57 | ######################################## 58 | # Create Azure Automation Account # 59 | ######################################## 60 | & .\createazureautomationaccount.ps1 ` 61 | -SubscriptionId $SubscriptionID ` 62 | -ResourceGroupName $ResourceGroupName ` 63 | -AutomationAccountName $AutomationAccountName ` 64 | -Location $Location ` 65 | -WorkspaceName $WorkspaceName ` 66 | -Verbose 67 | $WebhookURI = (Get-AzAutomationVariable ` 68 | -Name "WebhookURI" ` 69 | -ResourceGroupName $ResourceGroupName ` 70 | -AutomationAccountName $AutomationAccountName ` 71 | -ErrorAction SilentlyContinue).Value 72 | $WebhookURI 73 | 74 | ############################################## 75 | # Create Azure Automation RunAS Account # 76 | ############################################## 77 | # Follow Doc to create Azure Automation RunAS Account # 78 | 79 | 80 | ######################################################## 81 | # Grant RunAS Account WVD Contribute Permissions # 82 | ######################################################## 83 | $AARunAsID = Read-Host -Prompt "Enter Azure Automation RunAS Account ID" 84 | New-RdsRoleAssignment ` 85 | -ApplicationId $AARunAsID ` 86 | -TenantName $TenantName ` 87 | -RoleDefinitionName 'RDS Contributor' 88 | 89 | 90 | ########################## 91 | # Create Logic App # 92 | ########################## 93 | & .\createazurelogicapp.ps1 ` 94 | -ResourceGroupName $ResourceGroupName ` 95 | -AADTenantID $AADTenantID ` 96 | -SubscriptionID $SubscriptionID ` 97 | -TenantName $TenantName ` 98 | -HostPoolName $HostPoolName ` 99 | -RecurrenceInterval $RecurrenceInterval ` 100 | -BeginPeakTime $BeginPeakTime ` 101 | -EndPeakTime $EndPeakTime ` 102 | -TimeDifference $TimeDifference ` 103 | -SessionThresholdPerCPU $SessionThresholdPerCPU ` 104 | -MinimumNumberOfRDSH $MinimumNumberOfRdsh ` 105 | -LimitSecondsToForceLogOffUser $LimitSecondsToForceLogOffUser ` 106 | -LogOffMessageTitle $LogOffMessageTitle ` 107 | -LogOffMessageBody $LogOffMessageBody ` 108 | -Location $Location ` 109 | -ConnectionAssetName $ConnectionAssetName ` 110 | -WebHookURI $WebhookURI ` 111 | -AutomationAccountName $AutomationAccountName ` 112 | -MaintenanceTagName $MaintenanceTagName ` 113 | -Verbose 114 | 115 | 116 | -------------------------------------------------------------------------------- /PowerShell/WVDOptimize.ps1: -------------------------------------------------------------------------------- 1 | # Author : Dean Cefola 2 | # Creation Date: 07-09-2020 3 | # Usage : Windows Virtual Desktop Optimization Script 4 | # All code that this script executes is created and provided by THE VDI GUYS 5 | # You can download the code here -- https://github.com/The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool 6 | #****************************************************************************************************************** 7 | # Date Version Changes 8 | #----------------------------------------------------------------------------------------------------------------- 9 | # 05/20/2021 (Jason Masten) 1.1 Removed WindowsVersion parameter since the value is auto collected 10 | # Added parameter to Accept EULA 11 | # Added parameter & param block to allow Optimization choices 12 | # Fixed zip file changes 13 | # 14 | # 07/09/2020 1.0 Intial Version 15 | #****************************************************************************************************************** 16 | 17 | [Cmdletbinding()] 18 | Param ( 19 | [ValidateSet('All','WindowsMediaPlayer','AppxPackages','ScheduledTasks','DefaultUserSettings','Autologgers','Services','NetworkOptimizations','LGPO','DiskCleanup')] 20 | [String[]] 21 | $Optimizations = "All" 22 | ) 23 | 24 | ################################ 25 | # Download WVD Optimizer # 26 | ################################ 27 | New-Item -Path C:\ -Name Optimize -ItemType Directory -ErrorAction SilentlyContinue 28 | $LocalPath = "C:\Optimize\" 29 | $WVDOptimizeURL = 'https://github.com/The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool/archive/refs/heads/main.zip' 30 | $WVDOptimizeInstaller = "Windows_10_VDI_Optimize-master.zip" 31 | Invoke-WebRequest ` 32 | -Uri $WVDOptimizeURL ` 33 | -OutFile "$Localpath$WVDOptimizeInstaller" 34 | 35 | 36 | ############################### 37 | # Prep for WVD Optimize # 38 | ############################### 39 | Expand-Archive ` 40 | -LiteralPath "C:\Optimize\Windows_10_VDI_Optimize-master.zip" ` 41 | -DestinationPath "$Localpath" ` 42 | -Force ` 43 | -Verbose 44 | 45 | 46 | ################################# 47 | # Run WVD Optimize Script # 48 | ################################# 49 | New-Item -Path C:\Optimize\ -Name install.log -ItemType File -Force 50 | Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -Verbose 51 | add-content c:\Optimize\install.log "Starting Optimizations" 52 | & C:\Optimize\Virtual-Desktop-Optimization-Tool-main\Win10_VirtualDesktop_Optimize.ps1 -Optimizations $Optimizations -Restart -AcceptEULA -Verbose 53 | -------------------------------------------------------------------------------- /PowerShell/WVD_AAD_SVC_Prin.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 03-28-2019 3 | # Usage : Windows Virtual Desktop Functions 4 | 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 03/28/2019 1.0 Intial Version 9 | # 10 | # 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | 16 | ####################################### 17 | # Create WVD Service Principal # 18 | ####################################### 19 | $myTenantName = Read-Host -Prompt "Enter Tenant Name" 20 | Import-Module AzureAD 21 | $aadContext = Connect-AzureAD 22 | $svcPrincipal = New-AzureADApplication ` 23 | -AvailableToOtherTenants $true ` 24 | -DisplayName "Windows Virtual Desktop Svc Principal" 25 | $svcPrincipalCreds = New-AzureADApplicationPasswordCredential ` 26 | -ObjectId $svcPrincipal.ObjectId 27 | 28 | 29 | ################################# 30 | # Connect to WVD Service # 31 | ################################# 32 | $creds = New-Object System.Management.Automation.PSCredential($svcPrincipal.AppId, ` 33 | (ConvertTo-SecureString $svcPrincipalCreds.Value -AsPlainText -Force)) 34 | Add-RdsAccount ` 35 | -DeploymentUrl "https://rdbroker.wvd.microsoft.com" ` 36 | -Credential $creds ` 37 | -ServicePrincipal ` 38 | -AadTenantId $aadContext.TenantId.Guid 39 | 40 | 41 | ######################################### 42 | # Create New WVD Role Assignment # 43 | ######################################### 44 | New-RdsRoleAssignment ` 45 | -RoleDefinitionName "RDS Owner" ` 46 | -ApplicationId $svcPrincipal.AppId ` 47 | -TenantName $myTenantName 48 | 49 | 50 | ################################ 51 | # Service Principal Info # 52 | ################################ 53 | Write-host ` 54 | -BackgroundColor Black ` 55 | -ForegroundColor Cyan "AzureAD Directory ID - " ` 56 | -NoNewline $aadContext.TenantId.Guid 57 | "" 58 | "" 59 | Write-host ` 60 | -BackgroundColor Black ` 61 | -ForegroundColor Cyan "WVD SvcPrin ID - " ` 62 | -NoNewline $svcPrincipal.AppId 63 | "" 64 | "" 65 | Write-host ` 66 | -BackgroundColor Black ` 67 | -ForegroundColor Cyan "WVD SvcPrin Pwd - " ` 68 | -NoNewline $svcPrincipalCreds.Value 69 | "" 70 | "" 71 | 72 | 73 | -------------------------------------------------------------------------------- /PowerShell/Win365 AIB Process.ps1: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Windows 365 Azure Image Builder Process # 3 | ################################################# 4 | $rgName = 'CPC-RG' 5 | $location = "EastUS" 6 | $snapshotName = "Win11-365-SnapShot" 7 | $imageName = "Win11-365-Image" 8 | $diskname = "Win11-tempDisk" 9 | 10 | $sourceImgVer = Get-AzGalleryImageVersion ` 11 | -GalleryImageDefinitionName Win11Gen2 ` 12 | -GalleryName Win365Gallery ` 13 | -ResourceGroupName $rgName ` 14 | -Name 11.0.0 15 | 16 | $diskConfig = New-AzDiskConfig ` 17 | -Location EastUS ` 18 | -CreateOption FromImage ` 19 | -GalleryImageReference @{Id = $sourceImgVer.Id} ` 20 | -HyperVGeneration V2 21 | 22 | $TempDisk = New-AzDisk -Disk $diskConfig ` 23 | -ResourceGroupName $rgName ` 24 | -DiskName $diskname 25 | 26 | $NewSnapName = $snapshotName 27 | $SnapShotCfg = New-AzSnapshotConfig ` 28 | -SkuName Premium_LRS ` 29 | -OsType Windows ` 30 | -Location $location ` 31 | -CreateOption Copy ` 32 | -SourceResourceId $TempDisk.Id ` 33 | -HyperVGeneration V2 34 | 35 | $Snap = New-AzSnapshot ` 36 | -ResourceGroupName $rgName ` 37 | -SnapshotName $NewSnapName ` 38 | -Snapshot $SnapShotCfg ` 39 | -Verbose 40 | 41 | $imageConfig = New-AzImageConfig ` 42 | -Location $location ` 43 | -HyperVGeneration V2 44 | $imageConfig = Set-AzImageOsDisk ` 45 | -Image $imageConfig ` 46 | -OsState Generalized ` 47 | -OsType Windows ` 48 | -SnapshotId $Snap.Id 49 | New-AzImage ` 50 | -ImageName $imageName ` 51 | -ResourceGroupName $rgName ` 52 | -Image $imageConfig 53 | 54 | 55 | -------------------------------------------------------------------------------- /PowerShell/___AVD_Get App Group Assignment.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 07-09-2020 3 | # Usage : Get AVD App Group Assignment 4 | # 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 07/09/2020 1.0 Intial Version 9 | # 10 | 11 | #********************************************************************************* 12 | # 13 | #> 14 | ################### 15 | # Variables # 16 | ################### 17 | $RGName = 'GPU' 18 | $AppGroupName = 'HP-GPU-DAG' 19 | $AVDGroup = Get-AzWvdApplicationGroup ` 20 | -Name $AppGroupName ` 21 | -ResourceGroupName $RGName 22 | 23 | 24 | ################################# 25 | # Get AVD Role Assignment # 26 | ################################# 27 | Get-AzRoleAssignment ` 28 | -Scope $AVDGroup.Id | ` 29 | Where-Object ` 30 | -Property RoleDefinitionName ` 31 | -match 'Desktop Virtualization User' 32 | 33 | 34 | -------------------------------------------------------------------------------- /PowerShell/redirections.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage 6 | 7 | 8 | -------------------------------------------------------------------------------- /Recast/ImageAgentDeploy.ps1: -------------------------------------------------------------------------------- 1 | <#Author : Dean Cefola 2 | # Creation Date: 05-01-2025 3 | # Usage : Recast Agent Bootstrap - Dowload from Private Azure Blob Storage Container 4 | # 5 | #******************************************************************************** 6 | # Date Version Changes 7 | #------------------------------------------------------------------------ 8 | # 05/01/2025 1.0 Intial Version 9 | # 10 | 11 | #********************************************************************************* 12 | # 13 | #> 14 | 15 | ###################### 16 | # Configuration # 17 | ###################### 18 | $storageAccountName = "wvdfslogixeast02" # Storage Account Name 19 | $containerName = "recast" # Blob Container Name 20 | # Files to download 21 | $blobFiles = @( 22 | "Agent.exe", 23 | "Agent.json", 24 | "AgentBootstrapper-Win-2.1.0.2.exe", 25 | "AgentRegistration.cer" 26 | ) 27 | $DestinationPath = "C:\InstallFiles" # Target path in the AIB VM 28 | $InstallerPath = "C:\InstallFiles\AgentBootstrapper-Win-2.1.0.2.exe" 29 | $InstallerArguments = "/certificate=C:\InstallFiles\AgentRegistration.cer /startDeployment /waitForDeployment /logPath=C:\Windows\Temp" # Optional: Add any command-line arguments for the installer 30 | <#$response = Invoke-WebRequest -Uri "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2021-01-01&resource=https://storage.azure.com" -Headers @{"Metadata"="true"} 31 | $token = ($response.Content | ConvertFrom-Json).access_token 32 | $headers = @{ 33 | "Authorization" = "Bearer $token" 34 | "x-ms-version" = "2021-08-06" 35 | }#> 36 | 37 | 38 | ####################################### 39 | # DOWNLOAD FILES TO DESTINATION # 40 | ####################################### 41 | # Create destination directory 42 | if (!(Test-Path $DestinationPath)) { 43 | New-Item -ItemType Directory -Path $DestinationPath -Force | Out-Null 44 | } 45 | 46 | foreach ($blobName in $blobFiles) { 47 | $localFilePath = Join-Path $DestinationPath $blobName 48 | $blobUrl = "https://$storageAccountName.blob.core.windows.net/$containerName/$blobName" 49 | #Invoke-WebRequest -Uri $blobUrl -Headers $headers -OutFile $localFilePath 50 | Invoke-WebRequest -Uri $blobUrl -OutFile $localFilePath 51 | 52 | Write-Output "Downloading $blobName to $localFilePath..." 53 | try { 54 | Invoke-RestMethod -Uri $blobUrl -Headers $headers -OutFile $localFilePath 55 | Write-Output "$blobName downloaded successfully." 56 | } catch { 57 | Write-Output "Failed to download $blobName $_" 58 | } 59 | } 60 | 61 | Write-Output "All downloads completed." 62 | 63 | 64 | # =============================== 65 | set-location $DestinationPath 66 | 67 | # Start the install process 68 | 69 | Write-Host "Starting the installation process..." 70 | 71 | if (Test-Path -Path $InstallerPath) { 72 | 73 | try { 74 | 75 | Start-Process -FilePath $InstallerPath -ArgumentList $InstallerArguments -Wait 76 | 77 | Write-Host "Installation process completed." 78 | 79 | } catch { 80 | 81 | Write-Error "Error starting the installer '$InstallerPath': $($_.Exception.Message)" 82 | 83 | exit 1 84 | 85 | } 86 | 87 | } else { 88 | 89 | Write-Warning "Installer executable not found: '$InstallerPath'" 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Storage.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/Storage.bicep -------------------------------------------------------------------------------- /WVD Hack Network Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVD Hack Network Architecture.png -------------------------------------------------------------------------------- /WVD Hack Network Architecture.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVD Hack Network Architecture.vsdx -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Application Group Contributor.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Application Group Contributor","description":"WVD App Group Contributor","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/applicationgroups/startmenuitems/read","Microsoft.DesktopVirtualization/applicationgroups/desktops/delete","Microsoft.DesktopVirtualization/applicationgroups/desktops/write","Microsoft.DesktopVirtualization/applicationgroups/desktops/read","Microsoft.DesktopVirtualization/applicationgroups/applications/delete","Microsoft.DesktopVirtualization/applicationgroups/applications/write","Microsoft.DesktopVirtualization/applicationgroups/applications/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/applicationgroups/delete","Microsoft.DesktopVirtualization/applicationgroups/write","Microsoft.DesktopVirtualization/applicationgroups/read","Microsoft.Authorization/roleDefinitions/read","Microsoft.Authorization/roleAssignments/write","Microsoft.Authorization/roleAssignments/read","Microsoft.Authorization/permissions/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read"],"notActions":[],"dataActions":["Microsoft.DesktopVirtualization/applicationgroups/useapplications/action"],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Application Group Owner.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Application Group Owner","description":"App Group owner ","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0/resourceGroups/NewPortal"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/applicationgroups/startmenuitems/read","Microsoft.DesktopVirtualization/applicationgroups/desktops/delete","Microsoft.DesktopVirtualization/applicationgroups/desktops/write","Microsoft.DesktopVirtualization/applicationgroups/desktops/read","Microsoft.DesktopVirtualization/applicationgroups/applications/delete","Microsoft.DesktopVirtualization/applicationgroups/applications/write","Microsoft.DesktopVirtualization/applicationgroups/applications/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/applicationgroups/delete","Microsoft.DesktopVirtualization/applicationgroups/write","Microsoft.DesktopVirtualization/applicationgroups/read","Microsoft.Authorization/roleDefinitions/read","Microsoft.Authorization/roleAssignments/write","Microsoft.Authorization/roleAssignments/read","Microsoft.Authorization/permissions/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read","Microsoft.Authorization/roleAssignments/delete"],"notActions":[],"dataActions":["Microsoft.DesktopVirtualization/applicationgroups/useapplications/action"],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Application Group Reader.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Application Group Reader","description":"WVD App Group Reader","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/applicationgroups/startmenuitems/read","Microsoft.DesktopVirtualization/applicationgroups/desktops/read","Microsoft.DesktopVirtualization/applicationgroups/applications/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/applicationgroups/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/applicationgroups/read","Microsoft.Authorization/roleDefinitions/read","Microsoft.Authorization/roleAssignments/read","Microsoft.Authorization/permissions/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization AutoScale.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "roleName": "Desktop Virtualization Autoscale", 4 | "description": "Azure Virtual Desktop Autoscale Role", 5 | "assignableScopes": [ 6 | "/subscriptions/" 7 | ], 8 | "permissions": [ 9 | { 10 | "actions": [ 11 | "Microsoft.Compute/virtualMachines/deallocate/action", 12 | "Microsoft.Compute/virtualMachines/restart/action", 13 | "Microsoft.Compute/virtualMachines/powerOff/action", 14 | "Microsoft.Compute/virtualMachines/start/action", 15 | "Microsoft.Compute/virtualMachines/read", 16 | "Microsoft.DesktopVirtualization/hostpools/read", 17 | "Microsoft.DesktopVirtualization/hostpools/write", 18 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", 19 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", 20 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete", 21 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", 22 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action" 23 | ], 24 | "notActions": [], 25 | "dataActions": [], 26 | "notDataActions": [] 27 | } 28 | ] 29 | } 30 | } -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization HostPool Contributor.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization HostPool Contributor","description":"WVD HostPool Contributor","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete","Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/write","Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/delete","Microsoft.DesktopVirtualization/hostpools/sessionhosts/write","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/hostpools/delete","Microsoft.DesktopVirtualization/hostpools/write","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/write","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization HostPool Owner.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization HostPool Owner","description":"All host pool rights","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0/resourceGroups/NewPortal"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete","Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/write","Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/delete","Microsoft.DesktopVirtualization/hostpools/sessionhosts/write","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/hostpools/delete","Microsoft.DesktopVirtualization/hostpools/write","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/write","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.Authorization/roleAssignments/delete"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization HostPool Reader.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization HostPool Reader","description":"WVD HostPool Read rights","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read","Microsoft.DesktopVirtualization/hostpools/sessionhosts/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/hostpools/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/hostpools/read","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Session Host Config Reader.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties":{ 3 | "roleName":"Desktop Virtualization Session Host Config Reader", 4 | "description":"Dynamic Scaling Plan", 5 | "permissions":[ 6 | { 7 | "actions":[ 8 | "Microsoft.DesktopVirtualization/hostpools/activeSessionhostconfigurations/read" 9 | ], 10 | "notActions":[], 11 | "dataActions":[], 12 | "notDataActions":[] 13 | } 14 | ], 15 | "assignableScopes":[] 16 | } 17 | } -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Start VM On Connect.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties":{ 3 | "roleName":"Desktop Virtualization Start VM on Connect", 4 | "description":"Start WVD VM on Connect", 5 | "permissions":[ 6 | { 7 | "actions":[ 8 | "Microsoft.Compute/virtualMachines/start/action", 9 | "Microsoft.Compute/virtualMachines/read" 10 | ], 11 | "notActions":[], 12 | "dataActions":[], 13 | "notDataActions":[] 14 | } 15 | ], 16 | "assignableScopes":[] 17 | } 18 | } -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization User Admin.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization User Manager","description":"WVD User Management Role","assignableScopes":["/subscriptions/17a60df3-f02e-43a2-b52b-11abb3a53049"],"permissions":[{"actions":["Microsoft.Authorization/roleAssignments/delete","Microsoft.Authorization/roleAssignments/write","Microsoft.Authorization/roleAssignments/read","Microsoft.DesktopVirtualization/applicationgroups/desktops/read","Microsoft.DesktopVirtualization/applicationgroups/applications/read","Microsoft.DesktopVirtualization/applicationgroups/read","Microsoft.DesktopVirtualization/register/action"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Workspace Contributor.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Workspace Contributor","description":"WVD Workspace Contributor","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/workspaces/delete","Microsoft.DesktopVirtualization/workspaces/write","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/write","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read"],"notActions":[],"dataActions":["Microsoft.DesktopVirtualization/applicationgroups/useapplications/action"],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Workspace Owner.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Workspace Owner","description":"Workspace owner","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0/resourceGroups/NewPortal"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/diagnosticSettings/write","Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/workspaces/delete","Microsoft.DesktopVirtualization/workspaces/write","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/read","Microsoft.Resources/deployments/write","Microsoft.Resources/deployments/cancel/action","Microsoft.Resources/deployments/validate/action","Microsoft.Resources/deployments/whatIf/action","Microsoft.Resources/deployments/exportTemplate/action","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/write","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read","Microsoft.Authorization/roleAssignments/delete"],"notActions":[],"dataActions":["Microsoft.DesktopVirtualization/applicationgroups/useapplications/action"],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/Desktop Virtualization Workspace Reader.json: -------------------------------------------------------------------------------- 1 | {"properties":{"roleName":"Desktop Virtualization Workspace Reader","description":"WVD Workspace Reader","assignableScopes":["/subscriptions/c82ad9b5-1009-44fd-abdc-2b30f8e55ba0"],"permissions":[{"actions":["Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/logDefinitions/read","Microsoft.DesktopVirtualization/workspaces/providers/Microsoft.Insights/diagnosticSettings/read","Microsoft.DesktopVirtualization/workspaces/read","Microsoft.Resources/deployments/operationstatuses/read","Microsoft.Resources/deployments/operations/read","Microsoft.Resources/deployments/read","Microsoft.Resources/subscriptions/resourceGroups/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read","Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read","Microsoft.Resources/subscriptions/resourcegroups/resources/read"],"notActions":[],"dataActions":[],"notDataActions":[]}]}} -------------------------------------------------------------------------------- /WVD Permissions/HostPoolUpdate-RBAC.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "roleName": "HostPoolUpdate", 4 | "description": "Friendly description.", 5 | "assignableScopes": [ 6 | "/subscriptions/" 7 | ], 8 | "permissions": [ 9 | { 10 | "actions": [ 11 | "Microsoft.Compute/availabilitySets/read", 12 | "Microsoft.Compute/availabilitySets/write", 13 | "Microsoft.Compute/availabilitySets/vmSizes/read", 14 | "Microsoft.Compute/disks/read", 15 | "Microsoft.Compute/disks/write", 16 | "Microsoft.Compute/disks/delete", 17 | "Microsoft.Compute/galleries/read", 18 | "Microsoft.Compute/galleries/images/read", 19 | "Microsoft.Compute/galleries/images/versions/read", 20 | "Microsoft.Compute/images/read", 21 | "Microsoft.Compute/locations/usages/read", 22 | "Microsoft.Compute/locations/vmSizes/read", 23 | "Microsoft.Compute/operations/read", 24 | "Microsoft.Compute/skus/read", 25 | "Microsoft.Compute/virtualMachines/read", 26 | "Microsoft.Compute/virtualMachines/write", 27 | "Microsoft.Compute/virtualMachines/delete", 28 | "Microsoft.Compute/virtualMachines/start/action", 29 | "Microsoft.Compute/virtualMachines/powerOff/action", 30 | "Microsoft.Compute/virtualMachines/restart/action", 31 | "Microsoft.Compute/virtualMachines/deallocate/action", 32 | "Microsoft.Compute/virtualMachines/runCommand/action", 33 | "Microsoft.Compute/virtualMachines/extensions/read", 34 | "Microsoft.Compute/virtualMachines/extensions/write", 35 | "Microsoft.Compute/virtualMachines/extensions/delete", 36 | "Microsoft.Compute/virtualMachines/runCommands/read", 37 | "Microsoft.Compute/virtualMachines/runCommands/write", 38 | "Microsoft.Compute/virtualMachines/vmSizes/read", 39 | "Microsoft.Network/networkSecurityGroups/read", 40 | "Microsoft.Network/networkInterfaces/write", 41 | "Microsoft.Network/networkInterfaces/read", 42 | "Microsoft.Network/networkInterfaces/join/action", 43 | "Microsoft.Network/networkInterfaces/delete", 44 | "Microsoft.Network/virtualNetworks/subnets/read", 45 | "Microsoft.Network/virtualNetworks/subnets/join/action", 46 | "Microsoft.DesktopVirtualization/hostpools/read", 47 | "Microsoft.DesktopVirtualization/hostpools/write", 48 | "Microsoft.DesktopVirtualization/hostpools/delete", 49 | "Microsoft.DesktopVirtualization/hostpools/retrieveRegistrationToken/action", 50 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", 51 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", 52 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/delete", 53 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", 54 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/disconnect/action", 55 | "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action", 56 | "Microsoft.DesktopVirtualization/hostpools/sessionHostConfigurations/read", 57 | "Microsoft.Marketplace/offerTypes/publishers/offers/plans/agreements/read", 58 | "Microsoft.KeyVault/vaults/deploy/action", 59 | "Microsoft.Storage/storageAccounts/listkeys/action", 60 | "Microsoft.Storage/storageAccounts/read", 61 | "Microsoft.Resources/subscriptions/resourceGroups/read", 62 | "Microsoft.Resources/deployments/*", 63 | "Microsoft.Authorization/*/read", 64 | "Microsoft.Insights/alertRules/*", 65 | "Microsoft.Support/*" 66 | ], 67 | "notActions": [], 68 | "dataActions": [], 69 | "notDataActions": [] 70 | } 71 | ] 72 | } 73 | } -------------------------------------------------------------------------------- /WVDTemplates/.vs/WVD-NewHost/DesignTimeBuild/.dtbcache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVDTemplates/.vs/WVD-NewHost/DesignTimeBuild/.dtbcache -------------------------------------------------------------------------------- /WVDTemplates/.vs/WVD-NewHost/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVDTemplates/.vs/WVD-NewHost/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /WVDTemplates/.vs/WVD-NewHost/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVDTemplates/.vs/WVD-NewHost/v15/.suo -------------------------------------------------------------------------------- /WVDTemplates/.vs/WVD-NewHost/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeanCefola/Azure-WVD/9248ef3e66f42387e6ee9e7c84b43430b1daf9da/WVDTemplates/.vs/WVD-NewHost/v16/.suo -------------------------------------------------------------------------------- /WVDTemplates/AVDPrivateLink.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "hostpools_NewPool_HP_name": { 6 | "value": null 7 | }, 8 | "workspaces_NewPool_WS_name": { 9 | "value": null 10 | }, 11 | "privateEndpoints_NewPool_HP_Private_name": { 12 | "value": null 13 | }, 14 | "privateEndpoints_NewPool_WS_Private_name": { 15 | "value": null 16 | }, 17 | "workspaces_Standalone_WS_name": { 18 | "value": null 19 | }, 20 | "privateEndpoints_Standalone_WS_Private_name": { 21 | "value": null 22 | }, 23 | "networkInterfaces_NewPool_HP_Private_nic_name": { 24 | "value": null 25 | }, 26 | "networkInterfaces_NewPool_WS_Private_nic_name": { 27 | "value": null 28 | }, 29 | "networkInterfaces_Standalone_WS_Private_nic_name": { 30 | "value": null 31 | }, 32 | "applicationgroups_NewPool_HP_DAG_name": { 33 | "value": null 34 | }, 35 | "virtualNetworks_MSAA_vNET_externalid": { 36 | "value": null 37 | }, 38 | "privateDnsZones_privatelink_wvdselfhost_microsoft_com_externalid": { 39 | "value": null 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /WVDTemplates/AzureImageBuilder.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "imageTemplateName": { 6 | "type": "string" 7 | }, 8 | "api-version": { 9 | "type": "string" 10 | }, 11 | "svclocation": { 12 | "type": "string" 13 | } 14 | }, 15 | 16 | "variables": { 17 | }, 18 | 19 | 20 | "resources": [ 21 | { 22 | "name": "[parameters('imageTemplateName')]", 23 | "type": "Microsoft.VirtualMachineImages/imageTemplates", 24 | "apiVersion": "[parameters('api-version')]", 25 | "location": "[parameters('svclocation')]", 26 | "dependsOn": [], 27 | "tags": { 28 | "imagebuilderTemplate": "AzureImageBuilderSIG", 29 | "userIdentity": "enabled" 30 | }, 31 | "identity": { 32 | "type": "UserAssigned", 33 | "userAssignedIdentities": { 34 | "": {} 35 | 36 | } 37 | }, 38 | 39 | "properties": { 40 | "buildTimeoutInMinutes" : 120, 41 | 42 | "vmProfile": 43 | { 44 | "vmSize": "Standard_B2ms", 45 | "osDiskSizeGB": 127 46 | }, 47 | 48 | "source": { 49 | "type": "PlatformImage", 50 | "publisher": "MicrosoftWindowsDesktop", 51 | "offer": "office-365", 52 | "sku": "20h2-evd-o365pp", 53 | "version": "latest" 54 | }, 55 | "customize": [ 56 | { 57 | "type": "PowerShell", 58 | "name": "Install Teams", 59 | "runElevated": true, 60 | "runAsSystem": true, 61 | "scriptUri": "https://raw.githubusercontent.com/danielsollondon/azvmimagebuilder/master/solutions/14_Building_Images_WVD/2_installTeams.ps1" 62 | }, 63 | { 64 | "type": "WindowsRestart", 65 | "restartCheckCommand": "write-host 'restarting post Teams Install'", 66 | "restartTimeout": "5m" 67 | }, 68 | { 69 | "type": "WindowsUpdate", 70 | "searchCriteria": "IsInstalled=0", 71 | "filters": [ 72 | "exclude:$_.Title -like '*Preview*'", 73 | "include:$true" 74 | ], 75 | "updateLimit": 40 76 | } 77 | ], 78 | "distribute": 79 | [ 80 | { 81 | "type": "SharedImage", 82 | "galleryImageId": "/subscriptions//resourceGroups//providers/Microsoft.Compute/galleries//images/", 83 | "runOutputName": "", 84 | "artifactTags": { 85 | "source": "wvd10", 86 | "baseosimg": "windows10" 87 | }, 88 | "replicationRegions": [ 89 | "" 90 | 91 | ] 92 | } 93 | ] 94 | } 95 | } 96 | 97 | 98 | ] 99 | } 100 | -------------------------------------------------------------------------------- /WVDTemplates/WVD Resource Templates/New-DesktopAppGroup.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "AppGroupName": { 6 | "type": "string", 7 | "metadata": { 8 | "description": "Name for the WVD Desktop App Group" 9 | } 10 | }, 11 | "applicationGroupType": { 12 | "type": "string", 13 | "metadata": { 14 | "description": "Desktop or RemoteApp" 15 | }, 16 | "allowedValues": [ 17 | "Desktop", 18 | "RemoteApp" 19 | ], 20 | "defaultValue": "Desktop" 21 | }, 22 | "hostPoolArmPath": { 23 | "type": "string", 24 | "metadata": { 25 | "description": "Host Pool Resource ID" 26 | } 27 | } 28 | }, 29 | "variables": {}, 30 | "resources": [ 31 | { 32 | "type": "Microsoft.DesktopVirtualization/applicationGroups", 33 | "name": "[parameters('AppGroupName')]", 34 | "apiVersion": "2021-02-01-preview", 35 | "location": "[resourceGroup().location]", 36 | "properties": { 37 | "applicationGroupType": "[parameters('applicationGroupType')]", 38 | "description": "[concat(parameters('AppGroupName'),'Application Group')]", 39 | "friendlyName": "[concat(parameters('AppGroupName'),'app group')]", 40 | "hostPoolArmPath": "[parameters('hostPoolArmPath')]" 41 | } 42 | } 43 | ], 44 | "outputs": {} 45 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD Resource Templates/New-DesktopAppGroup.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "AppGroupName": { 6 | "value": "" // TODO: Fill in parameter value 7 | }, 8 | "applicationGroupType": { 9 | "value": "" // TODO: Fill in parameter value 10 | }, 11 | "hostPoolArmPath": { 12 | "value": "" // TODO: Fill in parameter value 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD Resource Templates/New-HostPool.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "hostpoolName": { 6 | "type": "string", 7 | "metadata": { 8 | "description": "The name of the Hostpool to be created." 9 | } 10 | } 11 | }, 12 | "variables": { 13 | 14 | }, 15 | "resources": [ 16 | { 17 | "name": "[parameters('hostpoolName')]", 18 | "apiVersion": "2019-12-10-preview", 19 | "type": "Microsoft.DesktopVirtualization/hostpools", 20 | "location": "[resourceGroup().location]", 21 | "properties": { 22 | "loadBalancerType": "BreadthFirst", 23 | "customRdpProperty": "", 24 | "maxSessionLimit": 10, 25 | "personalDesktopAssignmentType": "Automatic", 26 | "validationEnvironment": false, 27 | "hostPoolType": "Pooled", 28 | "preferredAppGroupType": "Desktop" 29 | } 30 | } 31 | ], 32 | "outputs": {} 33 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD Resource Templates/New-HostPool.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "hostpoolName": { 6 | "value": "test" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.757 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{151D2E53-A2C4-4D7D-83FE-D05416EBD58E}") = "WVD-NewHost", "WVD-NewHost\WVD-NewHost.deployproj", "{9C5EC938-F9FB-4FE8-983F-9D2C375E687D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9C5EC938-F9FB-4FE8-983F-9D2C375E687D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9C5EC938-F9FB-4FE8-983F-9D2C375E687D}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9C5EC938-F9FB-4FE8-983F-9D2C375E687D}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9C5EC938-F9FB-4FE8-983F-9D2C375E687D}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {BF4DC588-C465-4535-972C-9E1285CABB36} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/AVD-NewAADJoinHost.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "type": "string", 7 | "defaultValue": "avd" 8 | }, 9 | "AdminUserName": { 10 | "type": "string" 11 | }, 12 | "AdminPassword": { 13 | "type": "securestring" 14 | }, 15 | "DomainFQDN": { 16 | "type": "string" 17 | }, 18 | "Instance": { 19 | "type": "int", 20 | "minValue": 1, 21 | "maxValue": 99, 22 | "defaultValue": 1 23 | }, 24 | "OperatingSystem": { 25 | "type": "string", 26 | "defaultValue": "Client", 27 | "allowedValues": [ 28 | "Server", 29 | "Client" 30 | ] 31 | }, 32 | "VMSize": { 33 | "type": "string", 34 | "defaultValue": "Small", 35 | "allowedValues": [ 36 | "Small", 37 | "Medium", 38 | "Large" 39 | ] 40 | }, 41 | "VnetRgName": { 42 | "type": "string" 43 | }, 44 | "VnetName": { 45 | "type": "string" 46 | }, 47 | "SubnetName": { 48 | "type": "string" 49 | }, 50 | "ProfilePath": { 51 | "type": "string" 52 | }, 53 | "RegistrationToken": { 54 | "type": "string" 55 | }, 56 | "Optimize": { 57 | "type": "bool", 58 | "allowedValues": [ 59 | true, 60 | false 61 | ] 62 | } 63 | }, 64 | "variables": { 65 | "VM_Images": { 66 | "Server": { 67 | "publisher": "MicrosoftWindowsServer", 68 | "offer": "WindowsServer", 69 | "sku": "2019-Datacenter-smalldisk", 70 | "version": "latest" 71 | }, 72 | "Client": { 73 | "publisher": "microsoftwindowsdesktop", 74 | "offer": "office-365", 75 | "sku": "20h1-evd-o365pp", 76 | "version": "latest" 77 | } 78 | }, 79 | "VM_SIZES": { 80 | "Small": { 81 | "WVDsize": "Standard_B2ms" 82 | }, 83 | "Medium": { 84 | "WVDsize": "Standard_DS3_v2" 85 | }, 86 | "Large": { 87 | "WVDsize": "Standard_DS14_v2" 88 | } 89 | }, 90 | "License": { 91 | "Server": { 92 | "License": "Windows_Server" 93 | }, 94 | "Client": { 95 | "License": "Windows_Client" 96 | }, 97 | "Multi": { 98 | "License": "Windows_Client" 99 | } 100 | }, 101 | "VMName": "[concat(parameters('Prefix'),'-VM-')]", 102 | "subnetRef": "[concat(subscription().id,'/resourceGroups/',parameters('VnetRgName'),'/providers/Microsoft.Network/virtualNetworks/', parameters('VnetName'),'/subnets/', parameters('subnetName'))]", 103 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 104 | "fileUris": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1", 105 | "UriFileNamePieces": "[split(variables('fileUris'), '/')]", 106 | "firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]", 107 | "firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]", 108 | "firstFileName": "[variables('firstFileNameBreakString')[0]]", 109 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken'), ' -Optimize ', parameters('Optimize')))]" 110 | }, 111 | "resources": [ 112 | { 113 | "type": "Microsoft.Network/networkInterfaces", 114 | "name": "[concat(variables('VMName'),copyIndex(),'-nic')]", 115 | "apiVersion": "2018-10-01", 116 | "location": "[resourceGroup().location]", 117 | "copy": { 118 | "name": "WVDNic-Copy", 119 | "count": "[parameters('Instance')]" 120 | }, 121 | "tags": { 122 | "costcode": "AA-Money", 123 | "displayName": "WVD-Nic" 124 | }, 125 | "properties": { 126 | "ipConfigurations": [ 127 | { 128 | "name": "ipconfig1", 129 | "properties": { 130 | "subnet": { 131 | "id": "[variables('subnetRef')]" 132 | }, 133 | "privateIPAllocationMethod": "Dynamic" 134 | } 135 | } 136 | ] 137 | }, 138 | "dependsOn": [ 139 | 140 | ] 141 | 142 | }, 143 | { 144 | "type": "Microsoft.Compute/virtualMachines", 145 | "name": "[concat(variables('VMName'),copyIndex())]", 146 | "apiVersion": "2019-03-01", 147 | "location": "[resourceGroup().location]", 148 | "copy": { 149 | "name": "WVD-Copy", 150 | "count": "[parameters('Instance')]" 151 | }, 152 | "tags": { 153 | "costcode": "AA-Money", 154 | "displayName": "WVD-VM" 155 | }, 156 | "properties": { 157 | "hardwareProfile": { 158 | "vmSize": "[variables('VM_SIZES')[parameters('VMSize')].WVDsize]" 159 | }, 160 | "storageProfile": { 161 | "osDisk": { 162 | "name": "[concat(variables('VMName'),copyIndex(),'-OSDisk')]", 163 | "createOption": "FromImage", 164 | "managedDisk": { 165 | "storageAccountType": "StandardSSD_LRS" 166 | } 167 | }, 168 | "imageReference": { 169 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 170 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 171 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 172 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 173 | } 174 | }, 175 | "networkProfile": { 176 | "networkInterfaces": [ 177 | { 178 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('VMName'),copyIndex(),'-nic'))]" 179 | } 180 | ] 181 | }, 182 | "osProfile": { 183 | "computerName": "[concat(variables('VMName'),copyIndex())]", 184 | "adminUsername": "[parameters('AdminUserName')]", 185 | "adminPassword": "[parameters('AdminPassword')]", 186 | "windowsConfiguration": { 187 | "enableAutomaticUpdates": true, 188 | "provisionVmAgent": true 189 | } 190 | }, 191 | "licenseType": "[variables('License')[parameters('OperatingSystem')].License]" 192 | }, 193 | "zones": [ 194 | 1 195 | ], 196 | "dependsOn": [ 197 | "WVDNic-Copy" 198 | ] 199 | }, 200 | { 201 | "type": "Microsoft.Compute/virtualMachines/extensions", 202 | "name": "[concat(variables('VMName'),copyIndex(),'/CustomScriptExtension')]", 203 | "apiVersion": "2015-06-15", 204 | "location": "[resourceGroup().location]", 205 | "copy": { 206 | "name": "Script-Copy", 207 | "count": "[parameters('Instance')]" 208 | }, 209 | "properties": { 210 | "publisher": "Microsoft.Compute", 211 | "type": "CustomScriptExtension", 212 | "typeHandlerVersion": "1.9", 213 | "autoUpgradeMinorVersion": true, 214 | "settings": { 215 | "fileUris": [ 216 | "[variables('fileUris')]" 217 | ] 218 | }, 219 | "protectedSettings": { 220 | "commandToExecute": "[concat ('powershell -ExecutionPolicy Unrestricted -File ', variables('firstFileName'), ' ', variables('arguments'))]" 221 | } 222 | }, 223 | "dependsOn": [ 224 | "WVD-Copy" 225 | ] 226 | } 227 | ], 228 | "outputs": { 229 | 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/AVD-Win10-TrustedLaunch.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "type": "string", 7 | "defaultValue": "wvd" 8 | }, 9 | "AdminUserName": { 10 | "type": "string" 11 | }, 12 | "AdminPassword": { 13 | "type": "securestring" 14 | }, 15 | "DomainFQDN": { 16 | "type": "string" 17 | }, 18 | "Instance": { 19 | "type": "int", 20 | "minValue": 1, 21 | "maxValue": 99, 22 | "defaultValue": 1 23 | }, 24 | "OperatingSystem": { 25 | "type": "string", 26 | "defaultValue": "Client", 27 | "allowedValues": [ 28 | "Server", 29 | "Client" 30 | ] 31 | }, 32 | "VMSize": { 33 | "type": "string", 34 | "defaultValue": "Small", 35 | "allowedValues": [ 36 | "Small", 37 | "Medium", 38 | "Large" 39 | ] 40 | }, 41 | "VnetRgName": { 42 | "type": "string" 43 | }, 44 | "VnetName": { 45 | "type": "string" 46 | }, 47 | "SubnetName": { 48 | "type": "string" 49 | }, 50 | "ProfilePath": { 51 | "type": "string" 52 | }, 53 | "RegistrationToken": { 54 | "type": "string" 55 | }, 56 | "Optimize": { 57 | "type": "bool", 58 | "allowedValues": [ 59 | true, 60 | false 61 | ] 62 | } 63 | }, 64 | "variables": { 65 | "VM_Images": { 66 | "Server": { 67 | "publisher": "MicrosoftWindowsServer", 68 | "offer": "WindowsServer", 69 | "sku": "2019-Datacenter-smalldisk", 70 | "version": "latest" 71 | }, 72 | "Client": { 73 | "publisher": "MicrosoftWindowsDesktop", 74 | "offer": "Windows-10", 75 | "sku": "21h1-evd-g2", 76 | "version": "latest" 77 | } 78 | }, 79 | "VM_SIZES": { 80 | "Small": { 81 | "WVDsize": "Standard_B2ms" 82 | }, 83 | "Medium": { 84 | "WVDsize": "Standard_DS3_v2" 85 | }, 86 | "Large": { 87 | "WVDsize": "Standard_DS14_v2" 88 | } 89 | }, 90 | "License": { 91 | "Server": { 92 | "License": "Windows_Server" 93 | }, 94 | "Client": { 95 | "License": "Windows_Client" 96 | }, 97 | "Multi": { 98 | "License": "Windows_Client" 99 | } 100 | }, 101 | "VMName": "[concat(parameters('Prefix'),'-VM-')]", 102 | "subnetRef": "[concat(subscription().id,'/resourceGroups/',parameters('VnetRgName'),'/providers/Microsoft.Network/virtualNetworks/', parameters('VnetName'),'/subnets/', parameters('subnetName'))]", 103 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 104 | "fileUris": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1", 105 | "UriFileNamePieces": "[split(variables('fileUris'), '/')]", 106 | "firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]", 107 | "firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]", 108 | "firstFileName": "[variables('firstFileNameBreakString')[0]]", 109 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken'), ' -Optimize ', parameters('Optimize')))]" 110 | }, 111 | "resources": [ 112 | { 113 | "type": "Microsoft.Network/networkInterfaces", 114 | "name": "[concat(variables('VMName'),copyIndex(),'-nic')]", 115 | "apiVersion": "2021-03-01", 116 | "location": "[resourceGroup().location]", 117 | "copy": { 118 | "name": "WVDNic-Copy", 119 | "count": "[parameters('Instance')]" 120 | }, 121 | "tags": { 122 | "costcode": "AA-Money", 123 | "displayName": "WVD-Nic" 124 | }, 125 | "properties": { 126 | "ipConfigurations": [ 127 | { 128 | "name": "ipconfig1", 129 | "properties": { 130 | "subnet": { 131 | "id": "[variables('subnetRef')]" 132 | }, 133 | "privateIPAllocationMethod": "Dynamic" 134 | } 135 | } 136 | ] 137 | }, 138 | "dependsOn": [ 139 | 140 | ] 141 | 142 | }, 143 | { 144 | "type": "Microsoft.Compute/virtualMachines", 145 | "name": "[concat(variables('VMName'),copyIndex())]", 146 | "apiVersion": "2022-03-01", 147 | "location": "[resourceGroup().location]", 148 | "copy": { 149 | "name": "WVD-Copy", 150 | "count": "[parameters('Instance')]" 151 | }, 152 | "tags": { 153 | "costcode": "AA-Money", 154 | "displayName": "WVD-VM" 155 | }, 156 | "properties": { 157 | "hardwareProfile": { 158 | "vmSize": "[variables('VM_SIZES')[parameters('VMSize')].WVDsize]" 159 | }, 160 | "storageProfile": { 161 | "osDisk": { 162 | "name": "[concat(variables('VMName'),copyIndex(),'-OSDisk')]", 163 | "createOption": "FromImage", 164 | "managedDisk": { 165 | "storageAccountType": "StandardSSD_LRS" 166 | } 167 | }, 168 | "imageReference": { 169 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 170 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 171 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 172 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 173 | } 174 | }, 175 | "networkProfile": { 176 | "networkInterfaces": [ 177 | { 178 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('VMName'),copyIndex(),'-nic'))]" 179 | } 180 | ] 181 | }, 182 | "osProfile": { 183 | "computerName": "[concat(variables('VMName'),copyIndex())]", 184 | "adminUsername": "[parameters('AdminUserName')]", 185 | "adminPassword": "[parameters('AdminPassword')]", 186 | "windowsConfiguration": { 187 | "enableAutomaticUpdates": true, 188 | "provisionVmAgent": true 189 | } 190 | }, 191 | "licenseType": "[variables('License')[parameters('OperatingSystem')].License]", 192 | "securityProfile":{ 193 | "securityType": "TrustedLaunch", 194 | "uefiSettings": { 195 | "secureBootEnabled": true, 196 | "vTpmEnabled": true 197 | } 198 | } 199 | }, 200 | "zones": [ 201 | 1 202 | ], 203 | "dependsOn": [ 204 | "WVDNic-Copy" 205 | ] 206 | }, 207 | { 208 | "type": "Microsoft.Compute/virtualMachines/extensions", 209 | "name": "[concat(variables('VMName'),copyIndex(), '/joinDomain')]", 210 | "apiVersion": "2015-06-15", 211 | "location": "[resourceGroup().location]", 212 | "copy": { 213 | "name": "JoinDomain-Copy", 214 | "count": "[parameters('Instance')]" 215 | }, 216 | "tags": { 217 | "displayName": "Join Domain" 218 | }, 219 | "properties": { 220 | "publisher": "Microsoft.Compute", 221 | "type": "JsonADDomainExtension", 222 | "typeHandlerVersion": "1.3", 223 | "autoUpgradeMinorVersion": true, 224 | "settings": { 225 | "Name": "[parameters('DomainFQDN')]", 226 | "User": "[variables('JoinUser')]", 227 | "Restart": "true", 228 | "Options": "3" 229 | }, 230 | "protectedSettings": { 231 | "Password": "[parameters('adminPassword')]" 232 | } 233 | }, 234 | "dependsOn": [ 235 | "WVD-Copy" 236 | ] 237 | }, 238 | { 239 | "type": "Microsoft.Compute/virtualMachines/extensions", 240 | "name": "[concat(variables('VMName'),copyIndex(),'/CustomScriptExtension')]", 241 | "apiVersion": "2015-06-15", 242 | "location": "[resourceGroup().location]", 243 | "copy": { 244 | "name": "Script-Copy", 245 | "count": "[parameters('Instance')]" 246 | }, 247 | "properties": { 248 | "publisher": "Microsoft.Compute", 249 | "type": "CustomScriptExtension", 250 | "typeHandlerVersion": "1.9", 251 | "autoUpgradeMinorVersion": true, 252 | "settings": { 253 | "fileUris": [ 254 | "[variables('fileUris')]" 255 | ] 256 | }, 257 | "protectedSettings": { 258 | "commandToExecute": "[concat ('powershell -ExecutionPolicy Unrestricted -File ', variables('firstFileName'), ' ', variables('arguments'))]" 259 | } 260 | }, 261 | "dependsOn": [ 262 | "JoinDomain-Copy" 263 | ] 264 | } 265 | ], 266 | "outputs": { 267 | 268 | } 269 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/AVD-Win11-NewHost.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "type": "string", 7 | "defaultValue": "avd" 8 | }, 9 | "AdminUserName": { 10 | "type": "string" 11 | }, 12 | "AdminPassword": { 13 | "type": "securestring" 14 | }, 15 | "DomainFQDN": { 16 | "type": "string" 17 | }, 18 | "Instance": { 19 | "type": "int", 20 | "minValue": 1, 21 | "maxValue": 99, 22 | "defaultValue": 1 23 | }, 24 | "OperatingSystem": { 25 | "type": "string", 26 | "defaultValue": "Windows11", 27 | "allowedValues": [ 28 | "Windows11" 29 | ] 30 | }, 31 | "VMSize": { 32 | "type": "string", 33 | "defaultValue": "Small", 34 | "allowedValues": [ 35 | "Small", 36 | "Medium", 37 | "Large" 38 | ] 39 | }, 40 | "VnetRgName": { 41 | "type": "string" 42 | }, 43 | "VnetName": { 44 | "type": "string" 45 | }, 46 | "SubnetName": { 47 | "type": "string" 48 | }, 49 | "ProfilePath": { 50 | "type": "string" 51 | }, 52 | "RegistrationToken": { 53 | "type": "string" 54 | } 55 | }, 56 | "variables": { 57 | "VM_Images": { 58 | "Server": { 59 | "publisher": "MicrosoftWindowsServer", 60 | "offer": "WindowsServer", 61 | "sku": "2019-Datacenter-smalldisk", 62 | "version": "latest" 63 | }, 64 | "Windows10": { 65 | "publisher": "microsoftwindowsdesktop", 66 | "offer": "Windows-10", 67 | "sku": "20h2-ent", 68 | "version": "latest" 69 | }, 70 | "Windows11": { 71 | "publisher": "microsoftwindowsdesktop", 72 | "offer": "windows-11-preview", 73 | "sku": "win11-21h2-avd-m365", 74 | "version": "latest" 75 | } 76 | }, 77 | "VM_SIZES": { 78 | "Small": { 79 | "WVDsize": "Standard_B2ms" 80 | }, 81 | "Medium": { 82 | "WVDsize": "Standard_DS3_v2" 83 | }, 84 | "Large": { 85 | "WVDsize": "Standard_DS14_v2" 86 | } 87 | }, 88 | "License": { 89 | "Server": { 90 | "License": "Windows_Server" 91 | }, 92 | "Windows11": { 93 | "License": "Windows_Client" 94 | }, 95 | "Multi": { 96 | "License": "Windows_Client" 97 | } 98 | }, 99 | "VMName": "[concat(parameters('Prefix'),'-VM-')]", 100 | "subnetRef": "[concat(subscription().id,'/resourceGroups/',parameters('VnetRgName'),'/providers/Microsoft.Network/virtualNetworks/', parameters('VnetName'),'/subnets/', parameters('subnetName'))]", 101 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 102 | "fileUris": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-AVD-Win11-Host.ps1", 103 | "UriFileNamePieces": "[split(variables('fileUris'), '/')]", 104 | "firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]", 105 | "firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]", 106 | "firstFileName": "[variables('firstFileNameBreakString')[0]]", 107 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken')))]" 108 | }, 109 | "resources": [ 110 | { 111 | "type": "Microsoft.Network/networkInterfaces", 112 | "name": "[concat(variables('VMName'),copyIndex(),'-nic')]", 113 | "apiVersion": "2020-11-01", 114 | "location": "[resourceGroup().location]", 115 | "copy": { 116 | "name": "AVDNic-Copy", 117 | "count": "[parameters('Instance')]" 118 | }, 119 | "tags": { 120 | "costcode": "AA-Money", 121 | "displayName": "AVD-Nic" 122 | }, 123 | "properties": { 124 | "ipConfigurations": [ 125 | { 126 | "name": "ipconfig1", 127 | "properties": { 128 | "subnet": { 129 | "id": "[variables('subnetRef')]" 130 | }, 131 | "privateIPAllocationMethod": "Dynamic" 132 | } 133 | } 134 | ] 135 | }, 136 | "dependsOn": [ 137 | 138 | ] 139 | 140 | }, 141 | { 142 | "type": "Microsoft.Compute/virtualMachines", 143 | "name": "[concat(variables('VMName'),copyIndex())]", 144 | "apiVersion": "2021-03-01", 145 | "location": "[resourceGroup().location]", 146 | "copy": { 147 | "name": "AVD-Copy", 148 | "count": "[parameters('Instance')]" 149 | }, 150 | "tags": { 151 | "Application": "Windows 11", 152 | "cost center": "AA-Money", 153 | "Environment": "Lab", 154 | "Owner": "WVD Admin", 155 | "Support Contact": "x1234", 156 | "displayName": "AVD-VM" 157 | }, 158 | "properties": { 159 | "hardwareProfile": { 160 | "vmSize": "[variables('VM_SIZES')[parameters('VMSize')].WVDsize]" 161 | }, 162 | "storageProfile": { 163 | "osDisk": { 164 | "name": "[concat(variables('VMName'),copyIndex(),'-OSDisk')]", 165 | "createOption": "FromImage", 166 | "managedDisk": { 167 | "storageAccountType": "StandardSSD_LRS" 168 | } 169 | }, 170 | "imageReference": { 171 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 172 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 173 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 174 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 175 | } 176 | }, 177 | "networkProfile": { 178 | "networkInterfaces": [ 179 | { 180 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('VMName'),copyIndex(),'-nic'))]" 181 | } 182 | ] 183 | }, 184 | "osProfile": { 185 | "computerName": "[concat(variables('VMName'),copyIndex())]", 186 | "adminUsername": "[parameters('AdminUserName')]", 187 | "adminPassword": "[parameters('AdminPassword')]", 188 | "windowsConfiguration": { 189 | "enableAutomaticUpdates": true, 190 | "provisionVmAgent": true 191 | } 192 | }, 193 | "securityProfile": { 194 | "securityType": "TrustedLaunch", 195 | "uefiSettings": { 196 | "secureBootEnabled": true, 197 | "vTpmEnabled": true 198 | } 199 | }, 200 | "diagnosticsProfile": { 201 | "bootDiagnostics": { 202 | "enabled": true 203 | } 204 | }, 205 | "licenseType": "[variables('License')[parameters('OperatingSystem')].License]" 206 | }, 207 | "zones": [ 208 | 1 209 | ], 210 | "dependsOn": [ 211 | "AVDNic-Copy" 212 | ] 213 | }, 214 | { 215 | "type": "Microsoft.Compute/virtualMachines/extensions", 216 | "name": "[concat(variables('VMName'),copyIndex(), '/joinDomain')]", 217 | "apiVersion": "2015-06-15", 218 | "location": "[resourceGroup().location]", 219 | "copy": { 220 | "name": "JoinDomain-Copy", 221 | "count": "[parameters('Instance')]" 222 | }, 223 | "tags": { 224 | "displayName": "Join Domain" 225 | }, 226 | "properties": { 227 | "publisher": "Microsoft.Compute", 228 | "type": "JsonADDomainExtension", 229 | "typeHandlerVersion": "1.3", 230 | "autoUpgradeMinorVersion": true, 231 | "settings": { 232 | "Name": "[parameters('DomainFQDN')]", 233 | "User": "[variables('JoinUser')]", 234 | "Restart": "true", 235 | "Options": "3" 236 | }, 237 | "protectedSettings": { 238 | "Password": "[parameters('adminPassword')]" 239 | } 240 | }, 241 | "dependsOn": [ 242 | "AVD-Copy" 243 | ] 244 | }, 245 | { 246 | "type": "Microsoft.Compute/virtualMachines/extensions", 247 | "name": "[concat(variables('VMName'),copyIndex(),'/CustomScriptExtension')]", 248 | "apiVersion": "2015-06-15", 249 | "location": "[resourceGroup().location]", 250 | "copy": { 251 | "name": "Script-Copy", 252 | "count": "[parameters('Instance')]" 253 | }, 254 | "properties": { 255 | "publisher": "Microsoft.Compute", 256 | "type": "CustomScriptExtension", 257 | "typeHandlerVersion": "1.9", 258 | "autoUpgradeMinorVersion": true, 259 | "settings": { 260 | "fileUris": [ 261 | "[variables('fileUris')]" 262 | ] 263 | }, 264 | "protectedSettings": { 265 | "commandToExecute": "[concat ('powershell -ExecutionPolicy Unrestricted -File ', variables('firstFileName'), ' ', variables('arguments'))]" 266 | } 267 | }, 268 | "dependsOn": [ 269 | "JoinDomain-Copy" 270 | ] 271 | } 272 | ], 273 | "outputs": { 274 | 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/AVD-Win11-NewHost.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "value": "opt" 7 | }, 8 | "AdminUserName": { 9 | "value": "lntad" 10 | }, 11 | "DomainFQDN": { 12 | "value": "MSAzureAcademy.com" 13 | }, 14 | "Instance": { 15 | "value": 1 16 | }, 17 | "OperatingSystem": { 18 | "value": "Windows11" 19 | }, 20 | "VMSize": { 21 | "value": "Small" 22 | }, 23 | "VnetRgName": { 24 | "value": "MSAA-Network-rg" 25 | }, 26 | "VnetName": { 27 | "value": "MSAA-vNET" 28 | }, 29 | "SubnetName": { 30 | "value": "CoreSubnet" 31 | }, 32 | "ProfilePath": { 33 | "value": "\\\\msazureacademy.com\\CorpShares\\FSLogix" 34 | }, 35 | "RegistrationToken": { 36 | "value": "eyJhCWhQnGM3ohHKZ31JenFGzSZ" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/Deploy-AzureResourceGroup.ps1: -------------------------------------------------------------------------------- 1 | #Requires -Version 3.0 2 | 3 | Param( 4 | [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, 5 | [string] $ResourceGroupName = 'WVD-NewHost', 6 | [switch] $UploadArtifacts, 7 | [string] $StorageAccountName, 8 | [string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts', 9 | [string] $TemplateFile = 'azuredeploy.json', 10 | [string] $TemplateParametersFile = 'azuredeploy.parameters.json', 11 | [string] $ArtifactStagingDirectory = '.', 12 | [string] $DSCSourceFolder = 'DSC', 13 | [switch] $ValidateOnly 14 | ) 15 | 16 | try { 17 | [Microsoft.Azure.Common.Authentication.AzureSession]::ClientFactory.AddUserAgent("VSAzureTools-$UI$($host.name)".replace(' ','_'), '3.0.0') 18 | } catch { } 19 | 20 | $ErrorActionPreference = 'Stop' 21 | Set-StrictMode -Version 3 22 | 23 | function Format-ValidationOutput { 24 | param ($ValidationOutput, [int] $Depth = 0) 25 | Set-StrictMode -Off 26 | return @($ValidationOutput | Where-Object { $_ -ne $null } | ForEach-Object { @(' ' * $Depth + ': ' + $_.Message) + @(Format-ValidationOutput @($_.Details) ($Depth + 1)) }) 27 | } 28 | 29 | $OptionalParameters = New-Object -TypeName Hashtable 30 | $TemplateFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $TemplateFile)) 31 | $TemplateParametersFile = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $TemplateParametersFile)) 32 | 33 | if ($UploadArtifacts) { 34 | # Convert relative paths to absolute paths if needed 35 | $ArtifactStagingDirectory = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $ArtifactStagingDirectory)) 36 | $DSCSourceFolder = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($PSScriptRoot, $DSCSourceFolder)) 37 | 38 | # Parse the parameter file and update the values of artifacts location and artifacts location SAS token if they are present 39 | $JsonParameters = Get-Content $TemplateParametersFile -Raw | ConvertFrom-Json 40 | if (($JsonParameters | Get-Member -Type NoteProperty 'parameters') -ne $null) { 41 | $JsonParameters = $JsonParameters.parameters 42 | } 43 | $ArtifactsLocationName = '_artifactsLocation' 44 | $ArtifactsLocationSasTokenName = '_artifactsLocationSasToken' 45 | $OptionalParameters[$ArtifactsLocationName] = $JsonParameters | Select -Expand $ArtifactsLocationName -ErrorAction Ignore | Select -Expand 'value' -ErrorAction Ignore 46 | $OptionalParameters[$ArtifactsLocationSasTokenName] = $JsonParameters | Select -Expand $ArtifactsLocationSasTokenName -ErrorAction Ignore | Select -Expand 'value' -ErrorAction Ignore 47 | 48 | # Create DSC configuration archive 49 | if (Test-Path $DSCSourceFolder) { 50 | $DSCSourceFilePaths = @(Get-ChildItem $DSCSourceFolder -File -Filter '*.ps1' | ForEach-Object -Process {$_.FullName}) 51 | foreach ($DSCSourceFilePath in $DSCSourceFilePaths) { 52 | $DSCArchiveFilePath = $DSCSourceFilePath.Substring(0, $DSCSourceFilePath.Length - 4) + '.zip' 53 | Publish-AzVMDscConfiguration $DSCSourceFilePath -OutputArchivePath $DSCArchiveFilePath -Force -Verbose 54 | } 55 | } 56 | 57 | # Create a storage account name if none was provided 58 | if ($StorageAccountName -eq '') { 59 | $StorageAccountName = 'stage' + ((Get-AzContext).Subscription.SubscriptionId).Replace('-', '').substring(0, 19) 60 | } 61 | 62 | $StorageAccount = (Get-AzStorageAccount | Where-Object{$_.StorageAccountName -eq $StorageAccountName}) 63 | 64 | # Create the storage account if it doesn't already exist 65 | if ($StorageAccount -eq $null) { 66 | $StorageResourceGroupName = 'ARM_Deploy_Staging' 67 | New-AzResourceGroup -Location "$ResourceGroupLocation" -Name $StorageResourceGroupName -Force 68 | $StorageAccount = New-AzStorageAccount -StorageAccountName $StorageAccountName -Type 'Standard_LRS' -ResourceGroupName $StorageResourceGroupName -Location "$ResourceGroupLocation" 69 | } 70 | 71 | # Generate the value for artifacts location if it is not provided in the parameter file 72 | if ($OptionalParameters[$ArtifactsLocationName] -eq $null) { 73 | $OptionalParameters[$ArtifactsLocationName] = $StorageAccount.Context.BlobEndPoint + $StorageContainerName 74 | } 75 | 76 | # Copy files from the local storage staging location to the storage account container 77 | New-AzureStorageContainer -Name $StorageContainerName -Context $StorageAccount.Context -ErrorAction SilentlyContinue *>&1 78 | 79 | $ArtifactFilePaths = Get-ChildItem $ArtifactStagingDirectory -Recurse -File | ForEach-Object -Process {$_.FullName} 80 | foreach ($SourcePath in $ArtifactFilePaths) { 81 | Set-AzureStorageBlobContent -File $SourcePath -Blob $SourcePath.Substring($ArtifactStagingDirectory.length + 1) ` 82 | -Container $StorageContainerName -Context $StorageAccount.Context -Force 83 | } 84 | 85 | # Generate a 4 hour SAS token for the artifacts location if one was not provided in the parameters file 86 | if ($OptionalParameters[$ArtifactsLocationSasTokenName] -eq $null) { 87 | $OptionalParameters[$ArtifactsLocationSasTokenName] = ConvertTo-SecureString -AsPlainText -Force ` 88 | (New-AzureStorageContainerSASToken -Container $StorageContainerName -Context $StorageAccount.Context -Permission r -ExpiryTime (Get-Date).AddHours(4)) 89 | } 90 | } 91 | 92 | # Create the resource group only when it doesn't already exist 93 | if ((Get-AzResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose -ErrorAction SilentlyContinue) -eq $null) { 94 | New-AzResourceGroup -Name $ResourceGroupName -Location $ResourceGroupLocation -Verbose -Force -ErrorAction Stop 95 | } 96 | 97 | if ($ValidateOnly) { 98 | $ErrorMessages = Format-ValidationOutput (Test-AzResourceGroupDeployment -ResourceGroupName $ResourceGroupName ` 99 | -TemplateFile $TemplateFile ` 100 | -TemplateParameterFile $TemplateParametersFile ` 101 | @OptionalParameters) 102 | if ($ErrorMessages) { 103 | Write-Output '', 'Validation returned the following errors:', @($ErrorMessages), '', 'Template is invalid.' 104 | } 105 | else { 106 | Write-Output '', 'Template is valid.' 107 | } 108 | } 109 | else { 110 | New-AzResourceGroupDeployment -Name ((Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) ` 111 | -ResourceGroupName $ResourceGroupName ` 112 | -TemplateFile $TemplateFile ` 113 | -TemplateParameterFile $TemplateParametersFile ` 114 | @OptionalParameters ` 115 | -Force -Verbose ` 116 | -ErrorVariable ErrorMessages 117 | if ($ErrorMessages) { 118 | Write-Output '', 'Template deployment returned the following errors:', @(@($ErrorMessages) | ForEach-Object { $_.Exception.Message.TrimEnd("`r`n") }) 119 | } 120 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/Deployment.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | bin\$(Configuration)\ 7 | false 8 | true 9 | false 10 | None 11 | obj\ 12 | $(BaseIntermediateOutputPath)\ 13 | $(BaseIntermediateOutputPath)$(Configuration)\ 14 | $(IntermediateOutputPath)ProjectReferences 15 | $(ProjectReferencesOutputPath)\ 16 | true 17 | 18 | 19 | 20 | false 21 | false 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Always 33 | 34 | 35 | Never 36 | 37 | 38 | false 39 | Build 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | _GetDeploymentProjectContent; 48 | _CalculateContentOutputRelativePaths; 49 | _GetReferencedProjectsOutput; 50 | _CalculateArtifactStagingDirectory; 51 | _CopyOutputToArtifactStagingDirectory; 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Configuration=$(Configuration);Platform=$(Platform) 69 | 70 | 71 | 75 | 76 | 77 | 78 | $([System.IO.Path]::GetFileNameWithoutExtension('%(ProjectReference.Identity)')) 79 | 80 | 81 | 82 | 83 | 84 | 85 | $(OutDir) 86 | $(OutputPath) 87 | $(ArtifactStagingDirectory)\ 88 | $(ArtifactStagingDirectory)staging\ 89 | $(Build_StagingDirectory) 90 | 91 | 92 | 93 | 94 | 96 | 97 | <_OriginalIdentity>%(DeploymentProjectContentOutput.Identity) 98 | <_RelativePath>$(_OriginalIdentity.Replace('$(MSBuildProjectDirectory)', '')) 99 | 100 | 101 | 102 | 103 | $(_RelativePath) 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | PrepareForRun 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/Lighthouse.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "Parameters": { 5 | "mspName": { 6 | "value": "Doug FT PM" 7 | }, 8 | "mspOfferDescription": { 9 | "value": "MSP Demo" 10 | }, 11 | "managedByTenantID": { 12 | "value": "10c5dfa7-b5c3-4cf2-9265-f0e32a960967" 13 | }, 14 | "authorizations": { 15 | "value": [ 16 | { 17 | "principalId": "b50a6cf6-8067-4fbf-bc54-95f0dd6100bb", 18 | "principalIdDisplayName": "Admins", 19 | "roleRefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" 20 | } 21 | ] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/README.md: -------------------------------------------------------------------------------- 1 | # Windows Virtual Desktop Automated Deployment 2 | This template will 3 | - Allow you to select either a Windows Server or Windows Client VM for deployment 4 | - Auto join your Active Directory Domain 5 | - Download the latest WVD Installer Agent, Bootloader and FSLogix software 6 | - Auto configure the new VM(s) to join your Host Pool 7 | - Auto configure the new VM(s) to use a central storage location for WVD Profiles with FSLogix 8 | - Enable Screen Protection 9 | - Add WVD Optimizations for Windows 10 Multi-Session 10 | 11 | ---- 12 | ---- 13 | 14 | # Requirements: 15 | 16 | **Permissions:** 17 | - Azure Active Directory Global Administrator 18 | - Active Directory Administrator 19 | - Account to join AD Domain 20 | 21 | **Required Infrastructure:** 22 | - Create WVD HostPool 23 | - Create Active Directory domain for the new VM(s) to join 24 | - Create a central file share for WVD Profiles 25 | - **NOTE:** If You are using Azure Files with AD Authentication, this must be configured and required permissions added before you deploy. 26 | - Generate HostPool Regestration Token 27 | 28 | ---- 29 | ---- 30 | 31 | **New Windows 11 Session Host** 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ---- 41 | ---- 42 | 43 | **New Windows 10 Session Host** 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | ---- 53 | ---- 54 | 55 | **New Ephemeral Host** 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | ---- 65 | ---- 66 | 67 | # **The Azure Academy** 68 | ## Watch the Windows Virtual Desktop Series 69 | [![](https://tr1.cbsistatic.com/hub/i/2018/12/12/b685a2ae-3772-4214-9ba5-4205842dd50b/microsoft-wvdarchitecture.png)](https://www.youtube.com/playlist?list=PL-V4YVm6AmwXGvQ46W8mHkpvm6S5IIitK) 70 | 71 | 72 | If you are new to Azure virtual machines, see: 73 | 74 | - [Azure Virtual Machines](https://azure.microsoft.com/services/virtual-machines/). 75 | - [Azure Linux Virtual Machines documentation](https://docs.microsoft.com/azure/virtual-machines/linux/) 76 | - [Azure Windows Virtual Machines documentation](https://docs.microsoft.com/azure/virtual-machines/windows/) 77 | - [Template reference](https://docs.microsoft.com/azure/templates/microsoft.compute/allversions) 78 | - [Quickstart templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Compute&pageNumber=1&sort=Popular) 79 | 80 | If you are new to template deployment, see: 81 | 82 | [Azure Resource Manager documentation](https://docs.microsoft.com/azure/azure-resource-manager/) 83 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewEphemeralHost.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "type": "string", 7 | "defaultValue": "wvd" 8 | }, 9 | "AdminUserName": { 10 | "type": "string" 11 | }, 12 | "AdminPassword": { 13 | "type": "securestring" 14 | }, 15 | "DomainFQDN": { 16 | "type": "string" 17 | }, 18 | "Instance": { 19 | "type": "int", 20 | "minValue": 1, 21 | "maxValue": 99, 22 | "defaultValue": 1 23 | }, 24 | "OperatingSystem": { 25 | "type": "string", 26 | "defaultValue": "Client", 27 | "allowedValues": [ 28 | "Server", 29 | "Client" 30 | ] 31 | }, 32 | "VMSize": { 33 | "type": "string", 34 | "defaultValue": "Small", 35 | "allowedValues": [ 36 | "Small", 37 | "Medium", 38 | "Large" 39 | ] 40 | }, 41 | "VnetRgName": { 42 | "type": "string" 43 | }, 44 | "VnetName": { 45 | "type": "string" 46 | }, 47 | "SubnetName": { 48 | "type": "string" 49 | }, 50 | "ProfilePath": { 51 | "type": "string" 52 | }, 53 | "RegistrationToken": { 54 | "type": "string" 55 | } 56 | }, 57 | "variables": { 58 | "VM_Images": { 59 | "Server": { 60 | "publisher": "MicrosoftWindowsServer", 61 | "offer": "WindowsServer", 62 | "sku": "2019-Datacenter-smalldisk", 63 | "version": "latest" 64 | }, 65 | "Client": { 66 | "publisher": "microsoftwindowsdesktop", 67 | "offer": "office-365", 68 | "sku": "20h1-evd-o365pp", 69 | "version": "latest" 70 | } 71 | }, 72 | "VM_SIZES": { 73 | "Small": { 74 | "WVDsize": "Standard_DS3_v2" 75 | }, 76 | "Medium": { 77 | "WVDsize": "Standard_F16s" 78 | }, 79 | "Large": { 80 | "WVDsize": "Standard_DS14_v2" 81 | } 82 | }, 83 | "License": { 84 | "Server": { 85 | "License": "Windows_Server" 86 | }, 87 | "Client": { 88 | "License": "Windows_Client" 89 | }, 90 | "Multi": { 91 | "License": "Windows_Client" 92 | } 93 | }, 94 | "VMName": "[concat(parameters('Prefix'),'-VM-')]", 95 | "subnetRef": "[concat(subscription().id,'/resourceGroups/',parameters('VnetRgName'),'/providers/Microsoft.Network/virtualNetworks/', parameters('VnetName'),'/subnets/', parameters('subnetName'))]", 96 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 97 | "fileUris": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1", 98 | "UriFileNamePieces": "[split(variables('fileUris'), '/')]", 99 | "firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]", 100 | "firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]", 101 | "firstFileName": "[variables('firstFileNameBreakString')[0]]", 102 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken')))]" 103 | }, 104 | "resources": [ 105 | { 106 | "type": "Microsoft.Network/networkInterfaces", 107 | "name": "[concat(variables('VMName'),copyIndex(),'-nic')]", 108 | "apiVersion": "2018-10-01", 109 | "location": "[resourceGroup().location]", 110 | "copy": { 111 | "name": "WVDNic-Copy", 112 | "count": "[parameters('Instance')]" 113 | }, 114 | "tags": { 115 | "costcode": "AA-Money", 116 | "displayName": "WVD-Nic" 117 | }, 118 | "properties": { 119 | "ipConfigurations": [ 120 | { 121 | "name": "ipconfig1", 122 | "properties": { 123 | "subnet": { 124 | "id": "[variables('subnetRef')]" 125 | }, 126 | "privateIPAllocationMethod": "Dynamic" 127 | } 128 | } 129 | ] 130 | }, 131 | "dependsOn": [ 132 | 133 | ] 134 | 135 | }, 136 | { 137 | "type": "Microsoft.Compute/virtualMachines", 138 | "name": "[concat(variables('VMName'),copyIndex())]", 139 | "apiVersion": "2019-03-01", 140 | "location": "[resourceGroup().location]", 141 | "copy": { 142 | "name": "WVD-Copy", 143 | "count": "[parameters('Instance')]" 144 | }, 145 | "tags": { 146 | "costcode": "AA-Money", 147 | "displayName": "WVD-VM" 148 | }, 149 | "properties": { 150 | "hardwareProfile": { 151 | "vmSize": "[variables('VM_SIZES')[parameters('VMSize')].WVDsize]" 152 | }, 153 | "storageProfile": { 154 | "osDisk": { 155 | "name": "[concat(variables('VMName'),copyIndex(),'-OSDisk')]", 156 | "createOption": "FromImage", 157 | "managedDisk": { 158 | "storageAccountType": "Standard_LRS" 159 | }, 160 | "caching": "ReadOnly", 161 | "diffDiskSettings": { 162 | "option": "Local" 163 | } 164 | }, 165 | "imageReference": { 166 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 167 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 168 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 169 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 170 | } 171 | }, 172 | "networkProfile": { 173 | "networkInterfaces": [ 174 | { 175 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('VMName'),copyIndex(),'-nic'))]" 176 | } 177 | ] 178 | }, 179 | "osProfile": { 180 | "computerName": "[concat(variables('VMName'),copyIndex())]", 181 | "adminUsername": "[parameters('AdminUserName')]", 182 | "adminPassword": "[parameters('AdminPassword')]", 183 | "windowsConfiguration": { 184 | "enableAutomaticUpdates": true, 185 | "provisionVmAgent": true 186 | } 187 | }, 188 | "licenseType": "[variables('License')[parameters('OperatingSystem')].License]" 189 | }, 190 | "zones": [ 191 | 1 192 | ], 193 | "dependsOn": [ 194 | "WVDNic-Copy" 195 | ] 196 | }, 197 | { 198 | "type": "Microsoft.Compute/virtualMachines/extensions", 199 | "name": "[concat(variables('VMName'),copyIndex(), '/joinDomain')]", 200 | "apiVersion": "2015-06-15", 201 | "location": "[resourceGroup().location]", 202 | "copy": { 203 | "name": "JoinDomain-Copy", 204 | "count": "[parameters('Instance')]" 205 | }, 206 | "tags": { 207 | "displayName": "Join Domain" 208 | }, 209 | "properties": { 210 | "publisher": "Microsoft.Compute", 211 | "type": "JsonADDomainExtension", 212 | "typeHandlerVersion": "1.3", 213 | "autoUpgradeMinorVersion": true, 214 | "settings": { 215 | "Name": "[parameters('DomainFQDN')]", 216 | "User": "[variables('JoinUser')]", 217 | "Restart": "true", 218 | "Options": "3" 219 | }, 220 | "protectedSettings": { 221 | "Password": "[parameters('adminPassword')]" 222 | } 223 | }, 224 | "dependsOn": [ 225 | "WVD-Copy" 226 | ] 227 | }, 228 | { 229 | "type": "Microsoft.Compute/virtualMachines/extensions", 230 | "name": "[concat(variables('VMName'),copyIndex(),'/CustomScriptExtension')]", 231 | "apiVersion": "2015-06-15", 232 | "location": "[resourceGroup().location]", 233 | "copy": { 234 | "name": "Script-Copy", 235 | "count": "[parameters('Instance')]" 236 | }, 237 | "properties": { 238 | "publisher": "Microsoft.Compute", 239 | "type": "CustomScriptExtension", 240 | "typeHandlerVersion": "1.9", 241 | "autoUpgradeMinorVersion": true, 242 | "settings": { 243 | "fileUris": [ 244 | "[variables('fileUris')]" 245 | ] 246 | }, 247 | "protectedSettings": { 248 | "commandToExecute": "[concat ('powershell -ExecutionPolicy Unrestricted -File ', variables('firstFileName'), ' ', variables('arguments'))]" 249 | } 250 | }, 251 | "dependsOn": [ 252 | "JoinDomain-Copy" 253 | ] 254 | } 255 | ], 256 | "outputs": { 257 | 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewEphemeralHost.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "value": "Stateless" 7 | }, 8 | "AdminUserName": { 9 | "value": "lntad" 10 | }, 11 | "DomainFQDN": { 12 | "value": "MSAzureAcademy.com" 13 | }, 14 | "Instance": { 15 | "value": 1 16 | }, 17 | "OperatingSystem": { 18 | "value": "Client" 19 | }, 20 | "VMSize": { 21 | "value": "Small" 22 | }, 23 | "ProfilePath": { 24 | "value": "\\\\MSAzureAcademy.com\\CorpShares\\FSLogix" 25 | }, 26 | "RegistrationToken": { 27 | "value": "eyJhbGciOiJSUb2tlcig_owMfHGX2mjSlUmWvi2-kg" 28 | }, 29 | "VnetRgName": { 30 | "value": "AA-WVD-VNet-rg" 31 | }, 32 | "VnetName": { 33 | "value": "AA-WVD-vNET" 34 | }, 35 | "SubnetName": { 36 | "value": "CoreSubnet" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewHost.bicep: -------------------------------------------------------------------------------- 1 | param Prefix string = 'wvd' 2 | 3 | param AdminUserName string 4 | 5 | @secure() 6 | param AdminPassword string 7 | param DomainFQDN string 8 | 9 | @minValue(1) 10 | @maxValue(99) 11 | param Instance int = 1 12 | 13 | @allowed([ 14 | 'Server' 15 | 'Client' 16 | ]) 17 | param OperatingSystem string = 'Client' 18 | 19 | @allowed([ 20 | 'Small' 21 | 'Medium' 22 | 'Large' 23 | ]) 24 | param VMSize string = 'Small' 25 | param VnetRgName string 26 | param VnetName string 27 | param SubnetName string 28 | param ProfilePath string 29 | param RegistrationToken string 30 | 31 | @allowed([ 32 | true 33 | false 34 | ]) 35 | param Optimize bool 36 | 37 | var VM_Images = { 38 | Server: { 39 | publisher: 'MicrosoftWindowsServer' 40 | offer: 'WindowsServer' 41 | sku: '2019-Datacenter-smalldisk' 42 | version: 'latest' 43 | } 44 | Client: { 45 | publisher: 'microsoftwindowsdesktop' 46 | offer: 'office-365' 47 | sku: '20h1-evd-o365pp' 48 | version: 'latest' 49 | } 50 | } 51 | var VM_SIZES = { 52 | Small: { 53 | WVDsize: 'Standard_B2ms' 54 | } 55 | Medium: { 56 | WVDsize: 'Standard_DS3_v2' 57 | } 58 | Large: { 59 | WVDsize: 'Standard_DS14_v2' 60 | } 61 | } 62 | var License = { 63 | Server: { 64 | License: 'Windows_Server' 65 | } 66 | Client: { 67 | License: 'Windows_Client' 68 | } 69 | Multi: { 70 | License: 'Windows_Client' 71 | } 72 | } 73 | var VMName = '${Prefix}-VM-' 74 | var subnetRef = '${subscription().id}/resourceGroups/${VnetRgName}/providers/Microsoft.Network/virtualNetworks/${VnetName}/subnets/${SubnetName}' 75 | var JoinUser = '${AdminUserName}@${DomainFQDN}' 76 | var fileUris = 'https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1' 77 | var UriFileNamePieces = split(fileUris, '/') 78 | var firstFileNameString = UriFileNamePieces[(length(UriFileNamePieces) - 1)] 79 | var firstFileNameBreakString = split(firstFileNameString, '?') 80 | var firstFileName = firstFileNameBreakString[0] 81 | var Arguments = string('-ProfilePath ${ProfilePath} -RegistrationToken ${RegistrationToken} -Optimize ${Optimize}') 82 | 83 | resource VMName_nic 'Microsoft.Network/networkInterfaces@2018-10-01' = [for i in range(0, Instance): { 84 | name: '${VMName}${i}-nic' 85 | location: resourceGroup().location 86 | tags: { 87 | costcode: 'AA-Money' 88 | displayName: 'WVD-Nic' 89 | } 90 | properties: { 91 | ipConfigurations: [ 92 | { 93 | name: 'ipconfig1' 94 | properties: { 95 | subnet: { 96 | id: subnetRef 97 | } 98 | privateIPAllocationMethod: 'Dynamic' 99 | } 100 | } 101 | ] 102 | } 103 | dependsOn: [] 104 | } 105 | ] 106 | 107 | resource VM 'Microsoft.Compute/virtualMachines@2019-03-01' = [ 108 | for i in range(0, Instance): { 109 | name: concat(VMName, i) 110 | location: resourceGroup().location 111 | tags: { 112 | costcode: 'AA-Money' 113 | displayName: 'WVD-VM' 114 | } 115 | properties: { 116 | hardwareProfile: { 117 | vmSize: VM_SIZES[VMSize].WVDsize 118 | } 119 | storageProfile: { 120 | osDisk: { 121 | name: '${VMName}${i}-OSDisk' 122 | createOption: 'FromImage' 123 | managedDisk: { 124 | storageAccountType: 'StandardSSD_LRS' 125 | } 126 | } 127 | imageReference: { 128 | publisher: VM_Images[OperatingSystem].publisher 129 | offer: VM_Images[OperatingSystem].offer 130 | sku: VM_Images[OperatingSystem].sku 131 | version: VM_Images[OperatingSystem].version 132 | } 133 | } 134 | networkProfile: { 135 | networkInterfaces: [ 136 | { 137 | id: resourceId('Microsoft.Network/networkInterfaces', '${VMName}${i}-nic') 138 | } 139 | ] 140 | } 141 | osProfile: { 142 | computerName: concat(VMName, i) 143 | adminUsername: AdminUserName 144 | adminPassword: AdminPassword 145 | windowsConfiguration: { 146 | enableAutomaticUpdates: true 147 | provisionVMAgent: true 148 | } 149 | } 150 | licenseType: License[OperatingSystem].License 151 | } 152 | zones: [ 153 | 1 154 | ] 155 | dependsOn: [ 156 | VMName_nic 157 | ] 158 | } 159 | ] 160 | 161 | resource VMName_joinDomain 'Microsoft.Compute/virtualMachines/extensions@2015-06-15' = [ 162 | for i in range(0, Instance): { 163 | name: '${VMName}${i}/joinDomain' 164 | location: resourceGroup().location 165 | tags: { 166 | displayName: 'Join Domain' 167 | } 168 | properties: { 169 | publisher: 'Microsoft.Compute' 170 | type: 'JsonADDomainExtension' 171 | typeHandlerVersion: '1.3' 172 | autoUpgradeMinorVersion: true 173 | settings: { 174 | Name: DomainFQDN 175 | User: JoinUser 176 | Restart: 'true' 177 | Options: '3' 178 | } 179 | protectedSettings: { 180 | Password: AdminPassword 181 | } 182 | } 183 | dependsOn: [ 184 | VM 185 | ] 186 | } 187 | ] 188 | 189 | resource VMName_CustomScriptExtension 'Microsoft.Compute/virtualMachines/extensions@2015-06-15' = [ 190 | for i in range(0, Instance): { 191 | name: '${VMName}${i}/CustomScriptExtension' 192 | location: resourceGroup().location 193 | properties: { 194 | publisher: 'Microsoft.Compute' 195 | type: 'CustomScriptExtension' 196 | typeHandlerVersion: '1.9' 197 | autoUpgradeMinorVersion: true 198 | settings: { 199 | fileUris: [ 200 | fileUris 201 | ] 202 | } 203 | protectedSettings: { 204 | commandToExecute: 'powershell -ExecutionPolicy Unrestricted -File ${firstFileName} ${Arguments}' 205 | } 206 | } 207 | dependsOn: [ 208 | VMName_joinDomain 209 | ] 210 | } 211 | ] 212 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewHost.deployproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | Release 10 | AnyCPU 11 | 12 | 13 | 14 | 9c5ec938-f9fb-4fe8-983f-9d2c375e687d 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | False 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewHost.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "type": "string", 7 | "defaultValue": "wvd" 8 | }, 9 | "AdminUserName": { 10 | "type": "string" 11 | }, 12 | "AdminPassword": { 13 | "type": "securestring" 14 | }, 15 | "DomainFQDN": { 16 | "type": "string" 17 | }, 18 | "Instance": { 19 | "type": "int", 20 | "minValue": 1, 21 | "maxValue": 99, 22 | "defaultValue": 1 23 | }, 24 | "OperatingSystem": { 25 | "type": "string", 26 | "defaultValue": "Client", 27 | "allowedValues": [ 28 | "Server", 29 | "Client" 30 | ] 31 | }, 32 | "VMSize": { 33 | "type": "string", 34 | "defaultValue": "Small", 35 | "allowedValues": [ 36 | "Small", 37 | "Medium", 38 | "Large" 39 | ] 40 | }, 41 | "VnetRgName": { 42 | "type": "string" 43 | }, 44 | "VnetName": { 45 | "type": "string" 46 | }, 47 | "SubnetName": { 48 | "type": "string" 49 | }, 50 | "ProfilePath": { 51 | "type": "string" 52 | }, 53 | "RegistrationToken": { 54 | "type": "string" 55 | }, 56 | "Optimize": { 57 | "type": "bool", 58 | "allowedValues": [ 59 | true, 60 | false 61 | ] 62 | } 63 | }, 64 | "variables": { 65 | "VM_Images": { 66 | "Server": { 67 | "publisher": "MicrosoftWindowsServer", 68 | "offer": "WindowsServer", 69 | "sku": "2019-Datacenter-smalldisk", 70 | "version": "latest" 71 | }, 72 | "Client": { 73 | "publisher": "microsoftwindowsdesktop", 74 | "offer": "office-365", 75 | "sku": "20h1-evd-o365pp", 76 | "version": "latest" 77 | } 78 | }, 79 | "VM_SIZES": { 80 | "Small": { 81 | "WVDsize": "Standard_B2ms" 82 | }, 83 | "Medium": { 84 | "WVDsize": "Standard_DS3_v2" 85 | }, 86 | "Large": { 87 | "WVDsize": "Standard_DS14_v2" 88 | } 89 | }, 90 | "License": { 91 | "Server": { 92 | "License": "Windows_Server" 93 | }, 94 | "Client": { 95 | "License": "Windows_Client" 96 | }, 97 | "Multi": { 98 | "License": "Windows_Client" 99 | } 100 | }, 101 | "VMName": "[concat(parameters('Prefix'),'-VM-')]", 102 | "subnetRef": "[concat(subscription().id,'/resourceGroups/',parameters('VnetRgName'),'/providers/Microsoft.Network/virtualNetworks/', parameters('VnetName'),'/subnets/', parameters('subnetName'))]", 103 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 104 | "fileUris": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1", 105 | "UriFileNamePieces": "[split(variables('fileUris'), '/')]", 106 | "firstFileNameString": "[variables('UriFileNamePieces')[sub(length(variables('UriFileNamePieces')), 1)]]", 107 | "firstFileNameBreakString": "[split(variables('firstFileNameString'), '?')]", 108 | "firstFileName": "[variables('firstFileNameBreakString')[0]]", 109 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken'), ' -Optimize ', parameters('Optimize')))]" 110 | }, 111 | "resources": [ 112 | { 113 | "type": "Microsoft.Network/networkInterfaces", 114 | "name": "[concat(variables('VMName'),copyIndex(),'-nic')]", 115 | "apiVersion": "2018-10-01", 116 | "location": "[resourceGroup().location]", 117 | "copy": { 118 | "name": "WVDNic-Copy", 119 | "count": "[parameters('Instance')]" 120 | }, 121 | "tags": { 122 | "costcode": "AA-Money", 123 | "displayName": "WVD-Nic" 124 | }, 125 | "properties": { 126 | "ipConfigurations": [ 127 | { 128 | "name": "ipconfig1", 129 | "properties": { 130 | "subnet": { 131 | "id": "[variables('subnetRef')]" 132 | }, 133 | "privateIPAllocationMethod": "Dynamic" 134 | } 135 | } 136 | ] 137 | }, 138 | "dependsOn": [ 139 | 140 | ] 141 | 142 | }, 143 | { 144 | "type": "Microsoft.Compute/virtualMachines", 145 | "name": "[concat(variables('VMName'),copyIndex())]", 146 | "apiVersion": "2019-03-01", 147 | "location": "[resourceGroup().location]", 148 | "copy": { 149 | "name": "WVD-Copy", 150 | "count": "[parameters('Instance')]" 151 | }, 152 | "tags": { 153 | "costcode": "AA-Money", 154 | "displayName": "WVD-VM" 155 | }, 156 | "properties": { 157 | "hardwareProfile": { 158 | "vmSize": "[variables('VM_SIZES')[parameters('VMSize')].WVDsize]" 159 | }, 160 | "storageProfile": { 161 | "osDisk": { 162 | "name": "[concat(variables('VMName'),copyIndex(),'-OSDisk')]", 163 | "createOption": "FromImage", 164 | "managedDisk": { 165 | "storageAccountType": "StandardSSD_LRS" 166 | } 167 | }, 168 | "imageReference": { 169 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 170 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 171 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 172 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 173 | } 174 | }, 175 | "networkProfile": { 176 | "networkInterfaces": [ 177 | { 178 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('VMName'),copyIndex(),'-nic'))]" 179 | } 180 | ] 181 | }, 182 | "osProfile": { 183 | "computerName": "[concat(variables('VMName'),copyIndex())]", 184 | "adminUsername": "[parameters('AdminUserName')]", 185 | "adminPassword": "[parameters('AdminPassword')]", 186 | "windowsConfiguration": { 187 | "enableAutomaticUpdates": true, 188 | "provisionVmAgent": true 189 | } 190 | }, 191 | "licenseType": "[variables('License')[parameters('OperatingSystem')].License]" 192 | }, 193 | "zones": [ 194 | 1 195 | ], 196 | "dependsOn": [ 197 | "WVDNic-Copy" 198 | ] 199 | }, 200 | { 201 | "type": "Microsoft.Compute/virtualMachines/extensions", 202 | "name": "[concat(variables('VMName'),copyIndex(), '/joinDomain')]", 203 | "apiVersion": "2015-06-15", 204 | "location": "[resourceGroup().location]", 205 | "copy": { 206 | "name": "JoinDomain-Copy", 207 | "count": "[parameters('Instance')]" 208 | }, 209 | "tags": { 210 | "displayName": "Join Domain" 211 | }, 212 | "properties": { 213 | "publisher": "Microsoft.Compute", 214 | "type": "JsonADDomainExtension", 215 | "typeHandlerVersion": "1.3", 216 | "autoUpgradeMinorVersion": true, 217 | "settings": { 218 | "Name": "[parameters('DomainFQDN')]", 219 | "User": "[variables('JoinUser')]", 220 | "Restart": "true", 221 | "Options": "3" 222 | }, 223 | "protectedSettings": { 224 | "Password": "[parameters('adminPassword')]" 225 | } 226 | }, 227 | "dependsOn": [ 228 | "WVD-Copy" 229 | ] 230 | }, 231 | { 232 | "type": "Microsoft.Compute/virtualMachines/extensions", 233 | "name": "[concat(variables('VMName'),copyIndex(),'/CustomScriptExtension')]", 234 | "apiVersion": "2015-06-15", 235 | "location": "[resourceGroup().location]", 236 | "copy": { 237 | "name": "Script-Copy", 238 | "count": "[parameters('Instance')]" 239 | }, 240 | "properties": { 241 | "publisher": "Microsoft.Compute", 242 | "type": "CustomScriptExtension", 243 | "typeHandlerVersion": "1.9", 244 | "autoUpgradeMinorVersion": true, 245 | "settings": { 246 | "fileUris": [ 247 | "[variables('fileUris')]" 248 | ] 249 | }, 250 | "protectedSettings": { 251 | "commandToExecute": "[concat ('powershell -ExecutionPolicy Unrestricted -File ', variables('firstFileName'), ' ', variables('arguments'))]" 252 | } 253 | }, 254 | "dependsOn": [ 255 | "JoinDomain-Copy" 256 | ] 257 | } 258 | ], 259 | "outputs": { 260 | 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/WVD-NewHost.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "value": "opt" 7 | }, 8 | "AdminUserName": { 9 | "value": "lntad" 10 | }, 11 | "DomainFQDN": { 12 | "value": "MSAzureAcademy.com" 13 | }, 14 | "Instance": { 15 | "value": 1 16 | }, 17 | "OperatingSystem": { 18 | "value": "Client" 19 | }, 20 | "VMSize": { 21 | "value": "Small" 22 | }, 23 | "VnetRgName": { 24 | "value": "MSAA-Network-rg" 25 | }, 26 | "VnetName": { 27 | "value": "MSAA-vNET" 28 | }, 29 | "SubnetName": { 30 | "value": "CoreSubnet" 31 | }, 32 | "ProfilePath": { 33 | "value": "\\\\msazureacademy.com\\CorpShares\\FSLogix" 34 | }, 35 | "RegistrationToken": { 36 | "value": "eyJhCWhQnGM3ohHKZ31JenFGzSZ" 37 | }, 38 | "Optimize": { 39 | "value": true 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/customimage/New-CustomHost.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "Prefix": { 6 | "value": "Multi-10" 7 | }, 8 | "AdminUserName": { 9 | "value": "lntad" 10 | }, 11 | "DomainFQDN": { 12 | "value": "MSAzureAcademy.com" 13 | }, 14 | "Instance": { 15 | "value": 2 16 | }, 17 | "VMSize": { 18 | "value": "Small" 19 | }, 20 | "autoShutdownTime": { 21 | "value": "23:00" 22 | }, 23 | "autoShutdownTimeZone": { 24 | "value": "Eastern Standard Time" 25 | }, 26 | "VnetRgName": { 27 | "value": "AA-WVD-VNet-rg" 28 | }, 29 | "VnetName": { 30 | "value": "AA-WVD-vNET" 31 | }, 32 | "SubnetName": { 33 | "value": "CoreSubnet" 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/lighthouse.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "Parameters": { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/old/azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "adminUsername": { 6 | "type": "string" 7 | }, 8 | "adminPassword": { 9 | "type": "securestring" 10 | }, 11 | "DomainFQDN": { 12 | "type": "string" 13 | }, 14 | "OperatingSystem": { 15 | "type": "string", 16 | "defaultValue": "Client", 17 | "allowedValues": [ 18 | "Server", 19 | "Client" 20 | ] 21 | }, 22 | "VMSize": { 23 | "type": "string", 24 | "defaultValue": "Small", 25 | "allowedValues": [ 26 | "Small", 27 | "Medium", 28 | "Large" 29 | ] 30 | }, 31 | "subnetName": { 32 | "type": "string" 33 | }, 34 | "virtualNetworkId": { 35 | "type": "string" 36 | }, 37 | "virtualMachineName": { 38 | "type": "string" 39 | }, 40 | "ProfilePath": { 41 | "type": "string" 42 | }, 43 | "RegistrationToken": { 44 | "type": "string" 45 | } 46 | }, 47 | "variables": { 48 | "VM_Images": { 49 | "Server": { 50 | "publisher": "MicrosoftWindowsServer", 51 | "offer": "WindowsServer", 52 | "sku": "2019-Datacenter-smalldisk", 53 | "version": "latest" 54 | }, 55 | "Client": { 56 | "publisher": "microsoftwindowsdesktop", 57 | "offer": "office-365", 58 | "sku": "1903-evd-o365pp", 59 | "version": "latest" 60 | } 61 | }, 62 | "VM_SIZES": { 63 | "Small": { 64 | "WVDsize": "Standard_B2ms" 65 | }, 66 | "Medium": { 67 | "WVDsize": "Standard_DS3_v2" 68 | }, 69 | "Large": { 70 | "WVDsize": "Standard_DS14_v2" 71 | } 72 | }, 73 | "vnetId": "[parameters('virtualNetworkId')]", 74 | "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]", 75 | "JoinUser": "[concat(parameters('adminUsername'),'@',parameters('DomainFQDN'))]", 76 | "Arguments": "[string(concat('-ProfilePath ', parameters('ProfilePath'), ' -RegistrationToken ', parameters('RegistrationToken')))]" 77 | }, 78 | "resources": [ 79 | { 80 | "name": "[concat(parameters('virtualMachineName'),'-nic')]", 81 | "type": "Microsoft.Network/networkInterfaces", 82 | "apiVersion": "2018-10-01", 83 | "location": "[resourceGroup().location]", 84 | "dependsOn": [], 85 | "properties": { 86 | "ipConfigurations": [ 87 | { 88 | "name": "ipconfig1", 89 | "properties": { 90 | "subnet": { 91 | "id": "[variables('subnetRef')]" 92 | }, 93 | "privateIPAllocationMethod": "Dynamic" 94 | } 95 | } 96 | ] 97 | }, 98 | "tags": { 99 | "costcode": "AA-Money" 100 | } 101 | }, 102 | { 103 | "name": "[parameters('virtualMachineName')]", 104 | "type": "Microsoft.Compute/virtualMachines", 105 | "apiVersion": "2019-03-01", 106 | "location": "[resourceGroup().location]", 107 | "dependsOn": [ 108 | "[concat('Microsoft.Network/networkInterfaces/', parameters('virtualMachineName'),'-nic')]" 109 | ], 110 | "properties": { 111 | "hardwareProfile": { 112 | "vmSize": "Standard_B2ms" 113 | }, 114 | "storageProfile": { 115 | "osDisk": { 116 | "createOption": "fromImage", 117 | "managedDisk": { 118 | "storageAccountType": "StandardSSD_LRS" 119 | } 120 | }, 121 | "imageReference": { 122 | "publisher": "[variables('VM_IMAGES')[parameters('OperatingSystem')].publisher]", 123 | "offer": "[variables('VM_Images')[parameters('OperatingSystem')].offer]", 124 | "sku": "[variables('VM_Images')[parameters('OperatingSystem')].sku]", 125 | "version": "[variables('VM_Images')[parameters('OperatingSystem')].version]" 126 | } 127 | }, 128 | "networkProfile": { 129 | "networkInterfaces": [ 130 | { 131 | "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(parameters('virtualMachineName'),'-nic'))]" 132 | } 133 | ] 134 | }, 135 | "osProfile": { 136 | "computerName": "[parameters('virtualMachineName')]", 137 | "adminUsername": "[parameters('adminUsername')]", 138 | "adminPassword": "[parameters('adminPassword')]", 139 | "windowsConfiguration": { 140 | "enableAutomaticUpdates": true, 141 | "provisionVmAgent": true 142 | } 143 | }, 144 | "licenseType": "Windows_Client" 145 | }, 146 | "tags": { 147 | "costcode": "AA-Money" 148 | }, 149 | "zones": [ 150 | 1 151 | ] 152 | }, 153 | { 154 | "type": "Microsoft.Compute/virtualMachines/extensions", 155 | "name": "[concat(parameters('virtualMachineName'), '/joinDomain')]", 156 | "apiVersion": "2015-06-15", 157 | "location": "[resourceGroup().location]", 158 | "copy": { 159 | "name": "JoinDomain-Copy", 160 | "count": 1 161 | }, 162 | "tags": { 163 | "displayName": "Join Domain" 164 | }, 165 | "properties": { 166 | "publisher": "Microsoft.Compute", 167 | "type": "JsonADDomainExtension", 168 | "typeHandlerVersion": "1.3", 169 | "autoUpgradeMinorVersion": true, 170 | "settings": { 171 | "Name": "[parameters('DomainFQDN')]", 172 | "User": "[variables('JoinUser')]", 173 | "Restart": "true", 174 | "Options": "3" 175 | }, 176 | "protectedSettings": { 177 | "Password": "[parameters('adminPassword')]" 178 | } 179 | }, 180 | "dependsOn": [ 181 | "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]" 182 | ] 183 | }, 184 | { 185 | "type": "Microsoft.Resources/deployments", 186 | "name": "Microsoft.CustomScriptExtension-20190928132548", 187 | "apiVersion": "2015-01-01", 188 | "properties": { 189 | "mode": "incremental", 190 | "templateLink": { 191 | "uri": "https://gallery.azure.com/artifact/20161101/Microsoft.CustomScriptExtension-arm.2.0.56/Artifacts/MainTemplate.json" 192 | }, 193 | "parameters": { 194 | "vmName": { 195 | "value": "[parameters('virtualMachineName')]" 196 | }, 197 | "location": { 198 | "value": "[resourceGroup().location]" 199 | }, 200 | "fileUris": { 201 | "value": "https://raw.githubusercontent.com/DeanCefola/Azure-WVD/master/PowerShell/New-WVDSessionHost.ps1" 202 | }, 203 | "arguments": { 204 | "value": "[variables('Arguments')]" 205 | } 206 | } 207 | }, 208 | "dependsOn": [ 209 | "JoinDomain-Copy" 210 | ] 211 | } 212 | ], 213 | "outputs": { 214 | 215 | } 216 | } -------------------------------------------------------------------------------- /WVDTemplates/WVD-NewHost/old/azuredeploy.parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "subnetName": { 6 | "value": "CoreSubnet" 7 | }, 8 | "virtualNetworkId": { 9 | "value": "/subscriptions/25603d65-4ffd-4496-815d-417e73e71da3/resourceGroups/AA-WVD-VNet-rg/providers/Microsoft.Network/virtualNetworks/AA-WVD-vNET" 10 | }, 11 | "virtualMachineName": { 12 | "value": "WVD-001" 13 | }, 14 | "adminUsername": { 15 | "value": "lntad" 16 | }, 17 | "DomainFQDN": { 18 | "value": "MSAzureAcademy.com" 19 | }, 20 | "RegistrationToken": { 21 | "value": "eyJhbGciOiJasdSUzI1NiIsIM" 22 | }, 23 | "ProfilePath": { 24 | "value": "\\\\MSAzureAcademy.com\\CorpShares\\WVDProfile" 25 | } 26 | } 27 | } --------------------------------------------------------------------------------