Skip to content

techbloggingfool.com

  • Home
  • Gear
  • Microsoft
  • Linux
  • Apple
  • Networking
  • Gaming
  • Digital Notes
  • The Buzz
  • About
  • Contact

Tag: Orphaned UPD

PowerShell: Find User Profile Disks on all RDS Session Hosts

November 12, 2020Posted in MicrosoftTagged Disconnect UPD, Locate UPD, Orphaned UPD, RDS UPD, User Profile DisksLeave a comment

User Profile Disks in Remote Desktop Services allow for a consistent user experience in a distributed computing environment. UPDs utilize Hyper-V VHDX technology to ensure a user’s profile and data is available for their use regardless of which session host the connection broker directs the client to.

User Profile Disks replace the more well known roaming profile and folder redirection solutions. UPDs are easier to manage and use, for the most part. However, they occasionally become orphaned which requires an administrator to dismount the virtual disk. Unfortunately, this can be easier said than done. There isn’t a direct way to perform this function in the RDS Server Manager.

If you search the web for “find user profile disk”, you will inevitably encounter the Sidder app. This tool was a godsend when it was released during the 2012 era. Just download the app, double click the .exe, browse to the location of your UPDs, and a popup lists each user’s mounted virtual hard disk.

The Sidder App

The Sidder app worked great in its time, but in today’s remote work environments most RDS farms have more than a single session host and multiple UPD storage locations. Searching them all one at a time is tedious. PowerShell to the rescue. The code below will prompt for a username, just enter the name part, the domain will be added automatically. You’ll need to run it from an RDS server or a workstation with the RDS RSAT loaded.

 $UserToFind = Read-Host "Enter Username (e.g. firstname.lastname)?"
 $User = $env:USERDOMAIN + '\' + $UserToFind
 $RDCollection = Get-RDSessionCollection
 $RDHosts = Get-RDSessionHost -CollectionName $RDCollection.CollectionName | select SessionHost
  
 $Array = Invoke-Command -ComputerName $RDHosts.SessionHost -ScriptBlock {Get-Disk | select Location,DiskNumber | where {($_.Location -notmatch "Integrated") -and ($_.Location -notlike "PCI Slot *")}}
  
 $UPDs = @()
  
 foreach ($VHD in $Array){
 $DiskID = (Get-Item $VHD.Location).Name.Substring(5).Split(".")[0]
 $objSID = New-Object System.Security.Principal.SecurityIdentifier ($DiskID)
 $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
   if ($objUser.Value -eq $User){
    $UPDs += "$($objUser.Value) has user disk number $($VHD.DiskNumber) on $($VHD.PSComputername)"
   } 
 }
 If ($UPDS -ne $null) {$UPDs}
 Else {"$User does not have any user profile disks mounted in RDS"}
 pause 

This version will list all of the user profile disks in the RDS farm.

 $RDCollection = Get-RDSessionCollection
 $RDHosts = Get-RDSessionHost -CollectionName $RDCollection.CollectionName | select SessionHost
  
 $Array = Invoke-Command -ComputerName $RDHosts.SessionHost -ScriptBlock {Get-Disk | select Location,DiskNumber | where {($_.Location -notmatch "Integrated") -and ($_.Location -notlike "PCI Slot *")}}
  
 $UPDs = @()
  
 foreach ($VHD in $Array){
 $DiskID = (Get-Item $VHD.Location).Name.Substring(5).Split(".")[0]
 $objSID = New-Object System.Security.Principal.SecurityIdentifier ($DiskID)
 $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])
 $UPDs += "$($objUser.Value) has user disk number $($VHD.DiskNumber) on $($VHD.PSComputername)"
   }
 $UPDs 

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Tumblr (Opens in new window) Tumblr
Like Loading...
  • November 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017

Top Posts & Pages

  • Fixed Killer Network Manager Launcher Missing Link Error
    Fixed Killer Network Manager Launcher Missing Link Error
  • Ten Changes to Get the Most Out of Your Lenovo Legion Go
    Ten Changes to Get the Most Out of Your Lenovo Legion Go
  • Starfield, After the Fixes and DLC. A No Spoilers Review
    Starfield, After the Fixes and DLC. A No Spoilers Review
  • Digital Art and the XP-Pen Artist 15.6 drawing monitor
    Digital Art and the XP-Pen Artist 15.6 drawing monitor
  • Fix For Intel i225-V Ethernet Controller Dropping Connections with Event ID 27 e2fnexpress
    Fix For Intel i225-V Ethernet Controller Dropping Connections with Event ID 27 e2fnexpress
  • Deploy a Linux VM on Hyper-V with Sound 20.04 Edition
    Deploy a Linux VM on Hyper-V with Sound 20.04 Edition
  • Hogwarts Legacy, A Game Worth Finishing (No Spoilers Review)
    Hogwarts Legacy, A Game Worth Finishing (No Spoilers Review)
  • Fixed Moonlight Gamestream Freezing / Locking Up
    Fixed Moonlight Gamestream Freezing / Locking Up
  • Couch Gaming Perfection with the Logitech Lightspeed G915TKL Keyboard and G502 Mouse
    Couch Gaming Perfection with the Logitech Lightspeed G915TKL Keyboard and G502 Mouse
  • PowerShell: Backup and Repair/ Reset Windows Update.
    PowerShell: Backup and Repair/ Reset Windows Update.
  1. CJE's avatar
    CJE on Fixed Killer Network Manager Launcher Missing Link ErrorDecember 15, 2025

    You are a hero, thank you!

  2. suwaidionline's avatar
    suwaidionline on Ten Changes to Get the Most Out of Your Lenovo Legion GoDecember 12, 2025

    Love the practical tips on sound, updating, controls, GPU upscaling, and SSD upgrades super helpful for squeezing every bit of…

  3. suwaidionline's avatar
    suwaidionline on How to choose a Gaming Laptop; Lenovo Y700 ReviewDecember 12, 2025

    This gaming laptop guide + Lenovo Y700 review clearly explains how to pick the right specs (CPU, RAM, storage, GPU)…

  4. Yvan's avatar
    Yvan on Fixed Killer Network Manager Launcher Missing Link ErrorDecember 11, 2025

    I find myself today with the same problem. Surprised, I asked myself how this program got installed, because I didn’t…

  5. philippemp31's avatar
    philippemp31 on Fixed Killer Network Manager Launcher Missing Link ErrorDecember 2, 2025

    Thank you , it worked great !

Website Powered by WordPress.com.

Top Posts & Pages

  • Fixed Killer Network Manager Launcher Missing Link Error
  • Ten Changes to Get the Most Out of Your Lenovo Legion Go
  • Starfield, After the Fixes and DLC. A No Spoilers Review
  • Digital Art and the XP-Pen Artist 15.6 drawing monitor
  • Fix For Intel i225-V Ethernet Controller Dropping Connections with Event ID 27 e2fnexpress
  • Deploy a Linux VM on Hyper-V with Sound 20.04 Edition
  • Hogwarts Legacy, A Game Worth Finishing (No Spoilers Review)
  • Fixed Moonlight Gamestream Freezing / Locking Up
  • Couch Gaming Perfection with the Logitech Lightspeed G915TKL Keyboard and G502 Mouse
  • PowerShell: Backup and Repair/ Reset Windows Update.
  • Subscribe Subscribed
    • techbloggingfool.com
    • Join 175 other subscribers
    • Already have a WordPress.com account? Log in now.
    • techbloggingfool.com
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...
 

    %d