Monday, June 13, 2016

Caution when using Remove-AzureRemoteAppUserDisk in Azure RemoteApp PowerShell

You may have read my previous blog post about the announcement of new PowerShell CmdLets to manage User Profile Disks (UPD )in Azure RemoteApp, if not here is the link: User Profile Disk management for Azure RemoteApp is here!

These new CmdLets enable you to manage the User Profile Disks yourself. This is great because prior to this you had to contact Azure Support for every management task you had to do related to UPD. Check out my previous blog post for more details on the new CmdLets Copy-AzureRemoteAppUserDisk and Remove-AzureRemoteAppUserDisk.

One of the things I did run into when testing, is that the Remove-AzureRemoteAppUserDisk CmdLet does not check if the user associated with the UPD is active or not! So please be aware of this when using this command.

This is what happens when you accidentally run the command without checking if the user is active or not. The UPD is removed successfully and the user ends up with unexpected behavior in his session when trying to access application that try to contact the users profile. Basically the session becomes unreliable. Highlighted in green is the Remove-AzureRemoteAppUserDisk CmdLet that runs successfully while the user session (on the right) is active. Highlighted in red are some confirms that User Profile Disk is gone.

I have reported this back to the Product Team, and they are planning to have this fixed. In the meantime, be sure to confirm that the associated user is logged off prior to deleting the UPD.

Here are 2 ways to tell what users are logged on;

1. Using PowerShell and run the following command
Get-AzureRemoteAppVM -CollectionName <name of the collection>
For example below you will see that the user rdstest is currently logged on (and jwbqpqto000t is the hostname of the RDSH server)

2. Using the Azure Portal and opening the Session tab also allows you to confirm if a user if current logged on or not.

1 comment:

  1. I use Azure for microsoft ax and I use some tools and features, so I was happy when the new CmdLets appeared, which allows me to manage the User Profile Disks by myself. But I didn’t know anything about this error, so thank you for sharing this information, it will definitely be useful for me.