Resize User Profile Disks

Add a comment November 19th, 2013

If you have configured User Profile Disk (UPD) to be used with Virtual Desktops or Session Hosts (a.k.a. terminal services) you had to set a quota on the profile (the UPD which is a .vhdx file).

If you set the quota to i.e. 1 GB there might be some users filling it up with i.e. photos/videos and you’ll have to extend his/her .vhdx file:

  1. The affected user have to be logged off so the .vhdx file is not mounted
  2. Locate the UPD share and translate the user’s SID to username so you’ll get the correct file
  3. Take a backup (copy) of the file just in case…
  4. Resize the disk (either within Hyper-V Manager or with PowerShell)
  5. Mount the file and extend the disk within Disk Manager


I’ll show how this can be done with PowerShell.

After I have located the correct .vhdx file you can see the (max) size is 1 GB:



Run the Hyper-V cmdlets “Resize-VHD”:

Syntax: Resize-VHD –Path <to the .vhdx file> -SizeBytes xGB

Here I increase the size to 2 GB.


 Mount the .vhdx file and open Disk Manager

You’ll now see there are 1GB unallocated that you’ll have to claim


Extend the disk/volume


And the disk is now 2GB



Remember to unmounts/eject the disk/volume so the user can log on again.


  1. June 27th, 2014 at 16:16 | #1

    The term ‘Resize-VHD’ is not recognized as the name of a cmdlet

  2. June 27th, 2014 at 19:32 | #2

    Hi, assuming you have Win2012/Win8 you’ll have to import the Hyper-V module.

    Import-Module Hyper-V (the machine you are doing this on needs the Hyper-V feature added).

  3. December 27th, 2014 at 08:36 | #3

    If in the case of Windows 8, it also needs to be the “Professional” version.

  4. August 26th, 2015 at 12:05 | #4

    Expanding user profile disk using PowerShell:

  5. December 8th, 2015 at 08:43 | #5

    Run powershell from the Hyper-v host. Just type the path to the share where the UDP i stored. Worked perfekt for me.

  6. January 25th, 2018 at 09:19 | #6

    Instead of relying on Hyper-V (In some cases Hyper-V is not an option) I find it much easier to simply use diskpart.
    From CMD or powershell:

    Mount the disk in disk manager, expand it, unmount, done.
    The MAXIMUM value registers in mb, so 25 GB (as above example) would be 25600 (1024*25).

  7. September 19th, 2018 at 11:01 | #7
    Irakli Jojua

    @Mikael Dyreborg Hansen


  8. September 6th, 2019 at 17:40 | #8

    @Mikael Dyreborg Hansen

    Thank you! You saved my bacon sharing that one, I wasn’t able to use the Hyper-V module on a particular server and running into a brick wall.

  9. April 1st, 2020 at 10:08 | #9

    Thanks for sharing. on github i found a repo with an powershell script which also shrinks user profile disks:

  1. No trackbacks yet.
Comments feed

six − 3 =