Skip to content

Commit 0945108

Browse files
authored
Update app attach powershell
Customer pointed out in icm https://portal.microsofticm.com/imp/v5/incidents/details/516028572/summary that the documentation referenced parameters that were removed between private and public preview
1 parent d60f1cb commit 0945108

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

articles/virtual-desktop/app-attach-setup.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -392,32 +392,36 @@ Here's how to assign an application to groups and users using the [Az.DesktopVir
392392
}
393393
```
394394
395-
1. Once you have the object IDs of the users or groups, you can add them to or remove them from the application by using one of the following examples, which assigns the [Desktop Virtualization User](rbac.md#desktop-virtualization-user) RBAC role. You can also assign the Desktop Virtualization User RBAC role to your groups or users using the [New-AzRoleAssignment](../role-based-access-control/role-assignments-powershell.md) cmdlet.
395+
1. Once you have the object IDs of the users or groups, you can add them to or remove them from the application by using one of the following examples, which assigns the [Desktop Virtualization User](rbac.md#desktop-virtualization-user) RBAC role.
396396
397397
1. To add the groups or users to the application, run the following command:
398398
399399
```azurepowershell
400-
$parameters = @{
401-
Name = '<AppName>'
402-
ResourceGroupName = '<ResourceGroupName>'
403-
Location = '<AzureRegion>'
404-
PermissionsToAdd = $Ids
400+
$getParameters = @{
401+
Name = '<AppName>'
402+
ResourceGroupName = '<ResourceGroupName>'
403+
}
404+
405+
$appAttachPackage = Get-AzWvdAppAttachPackage @getParameters
406+
407+
foreach ($item in $Ids) {
408+
New-AzRoleAssignment -ObjectId $item -RoleDefinitionName "Desktop Virtualization User" -Scope $appAttachPackage.Id
405409
}
406-
407-
Update-AzWvdAppAttachPackage @parameters
408410
```
409411
410412
1. To remove the groups or users to the application, run the following command:
411413
412414
```azurepowershell
413-
$parameters = @{
414-
Name = '<AppName>'
415-
ResourceGroupName = '<ResourceGroupName>'
416-
Location = '<AzureRegion>'
417-
PermissionsToRemove = $objectIds
415+
$getParameters = @{
416+
Name = '<AppName>'
417+
ResourceGroupName = '<ResourceGroupName>'
418+
}
419+
420+
$appAttachPackage = Get-AzWvdAppAttachPackage @getParameters
421+
422+
foreach ($item in $Ids) {
423+
Remove-AzRoleAssignment -ObjectId $item -RoleDefinitionName "Desktop Virtualization User" -Scope $appAttachPackage.Id
418424
}
419-
420-
Update-AzWvdAppAttachPackage @parameters
421425
```
422426
423427
---
@@ -451,8 +455,7 @@ Here's how to change a package's registration type and state using the [Az.Deskt
451455
452456
```azurepowershell
453457
$parameters = @{
454-
FullName = '<FullName>'
455-
HostPoolName = '<HostPoolName>'
458+
Name = '<Name>'
456459
ResourceGroupName = '<ResourceGroupName>'
457460
Location = '<AzureRegion>'
458461
IsRegularRegistration = $true
@@ -466,7 +469,6 @@ Here's how to change a package's registration type and state using the [Az.Deskt
466469
```azurepowershell
467470
$parameters = @{
468471
Name = '<Name>'
469-
HostPoolName = '<HostPoolName>'
470472
ResourceGroupName = '<ResourceGroupName>'
471473
Location = '<AzureRegion>'
472474
IsActive = $true

0 commit comments

Comments
 (0)