Skip to content

Powershell – Find UPD Disk and RDHost

With User Profile Disks it sometimes so happens that due to a connection issue or whatever reason a user’s disk does not properly disconnect from the Remote Desktop Host. This can cause issues with for example File Explorer not functioning or loads of other nuisances.

Going through all the disks in the Disk Management to see which one belongs to which user takes some time. So I have made a Powershell script to find which disk on which host, run this on the broker:

Next thing to do is to connect to the RDS Host and detach the VHD via the Disk Management.

Disk Management

Ultimately you could include it in the script to be done automatically instead of getting the “$result =”. But I personally prefer to do it manually 🙂

Happy scripting and stay safe!

Published inPowerShellServer 2016Server 2019Windows Server

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *