{"id":678,"date":"2024-02-25T16:06:00","date_gmt":"2024-02-25T22:06:00","guid":{"rendered":"https:\/\/blog.nukeitmike.com\/?p=678"},"modified":"2024-02-25T16:07:14","modified_gmt":"2024-02-25T22:07:14","slug":"further-avd-adventures","status":"publish","type":"post","link":"https:\/\/blog.nukeitmike.com\/index.php\/2024\/02\/25\/further-avd-adventures\/","title":{"rendered":"Further AVD Adventures"},"content":{"rendered":"<p>I mentioned in a previous post that we were experimenting with Azure Virtual Desktop.&nbsp; One of the things that I need to be able to do is launch from a web page.&nbsp; We have figured out how to do that using this info:&nbsp; <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-desktop\/uri-scheme\">Uniform Resource Identifier schemes with the Remote Desktop client for Azure Virtual Desktop (preview) | Microsoft Learn<\/a><\/p>\n<p>But you have to look up the Workspace ID and Application ID.&nbsp; You come up something like this:<\/p>\n<p>ms-avd:connect?workspaceId=1638e073-63b2-46d8-bd84-ea02ea905467&amp;resourceid=c2f5facc-196f-46af-991e-a90f3252c185&amp;username=user@contoso.com&amp;version=0<\/p>\n<p><\/p>\n<p>That is great, but you have to use a script to get the IDs.&nbsp;&nbsp; Not hard, but you have to pass a log of information in, and I am lazy.&nbsp; I thought it might be worth writing a script to pull all the app ids for the Workspace.<\/p>\n<p><\/p>\n<p>If you run this bit (after authentication and defining variables):<\/p>\n<p>$workspace = Get-AzWvdWorkspace -Name $WorkSpaceName -ResourceGroupName $WorkspaceRG<\/p>\n<p>$workspace.ApplicationGroupReference<\/p>\n<p><\/p>\n<p>You get a list of the App Group references that looks something like this:<\/p>\n<p>PS C:\\Users\\Michael&gt; $workspace.ApplicationGroupReference<br \/>\n\/subscriptions\/&lt;SubscirptionID&gt;\/resourcegroups\/&lt;AppGroupResourceGroup&gt;\/providers\/Microsoft.DesktopVirtualization\/applicationgroups\/&lt;Application-Group-Name&gt;<\/p>\n<p>\/subscriptions\/&lt;SubscirptionID&gt;\/resourcegroups\/&lt;AppGroupResourceGroup&gt;\/providers\/Microsoft.DesktopVirtualization\/applicationgroups\/&lt;Application-Group-Name&gt;<\/p>\n<p>\/subscriptions\/&lt;SubscirptionID&gt;\/resourcegroups\/&lt;AppGroupResourceGroup&gt;\/providers\/Microsoft.DesktopVirtualization\/applicationgroups\/&lt;Application-Group-Name&gt;<\/p>\n<p>\/subscriptions\/&lt;SubscirptionID&gt;\/resourcegroups\/&lt;AppGroupResourceGroup&gt;\/providers\/Microsoft.DesktopVirtualization\/applicationgroups\/&lt;Application-Group-Name&gt;<\/p>\n<p><\/p>\n<p>You will get all the AppGroups associated with the Workspace.&nbsp; You can break that up and get the app ids with the following:<\/p>\n<p><\/p>\n<p><\/p>\n<blockquote>\n<p><em>$SubsrciptionName = &#8220;&lt;YourSubscriptionName&gt;&#8221;<br \/>\n$WorkSpaceName = &#8220;&lt;WorkspaceName&gt;&#8221;<br \/>\n$WorkspaceRG = &#8220;&lt;WorkspaceResourceGroup&gt;&#8221;<\/em><\/p>\n<p><em><br \/>\n<\/em><\/p>\n<p><em><br \/>\nConnect-AzAccount<\/em><\/p>\n<p><em><br \/>\n<\/em><\/p>\n<p><em>Set-AzContext -Subscription $SubsrciptionName<\/em><\/p>\n<p><em><br \/>\n<\/em><\/p>\n<p><em>$workspace = Get-AzWvdWorkspace -Name $WorkSpaceName -ResourceGroupName $WorkspaceRG<br \/>\n$workspaceID = $Workspace.ObjectID<br \/>\n$appGroupReference = $workspace.ApplicationGroupReference<\/em><\/p>\n<p><em><br \/>\n<\/em><\/p>\n<p><em>Foreach ($appGroup in $appGroupReference) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp; $AppGroupParts = $appGroup -split &#8220;\/&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp; $apps = Get-AzWvdApplication -ApplicationGroupName $AppGroupParts[8] -ResourceGroupName $AppGroupParts[4] | Select-Object Name, FilePath, ObjectId<br \/>&nbsp;&nbsp;&nbsp;&nbsp; foreach ($app in $apps) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host &#8220;&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host &#8220;*********************************************&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host &#8220;To launch $($app.Name) use the following:&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-Host &#8220;ms-avd:connect?workspaceId=$workspaceID&amp;resourceid=$($app.ObjectId)&amp;username=&lt;your@domain.com&gt;&amp;version=0&#8221;<\/em><br \/>&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>}<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I mentioned in a previous post that we were experimenting with Azure Virtual Desktop.&nbsp; One of the things that I need to be able to do is launch from a web page.&nbsp; We have figured out how to do that using this info:&nbsp; Uniform Resource Identifier schemes with the Remote Desktop client for Azure Virtual&hellip; <a class=\"more-link\" href=\"https:\/\/blog.nukeitmike.com\/index.php\/2024\/02\/25\/further-avd-adventures\/\">Continue reading <span class=\"screen-reader-text\">Further AVD Adventures<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,17,209,25],"tags":[52,206,205,120,135,154],"class_list":["post-678","post","type-post","status-publish","format-standard","hentry","category-azure","category-microsoft","category-powershell","category-scripting","tag-azure","tag-azure-remote-app","tag-azure-virtual-desktop","tag-microsoft","tag-powershell","tag-scripting","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pcW544-aW","_links":{"self":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/comments?post=678"}],"version-history":[{"count":1,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":679,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/678\/revisions\/679"}],"wp:attachment":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/media?parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/categories?post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/tags?post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}