
For anyone running into the same problem I would advise using diskpart to compress your VHDX files. Just run the following from an elevated command prompt.
select vdisk file=\\path\to\file.vhdx
attach vdisk readonly
compact vdisk
detach vdisk
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm using the FSLogix application frx.exe to reduce the size of my users' office profile VHDX file with the command
frx.exe migrate-vhd -src path_to_old.vhdx" -dest path_to_new.vhdx -dynamic=1
This appears to work fine, I get no errors. and the file size comes down. However, when the user logs in, their OneDrive is a mess. If they try to open files from their desktop or my documents (directories synced with OneDrive) they become corrupted and irretreivable.
The only fix I've been able to find, is to un register their one drive and then re-register it. OneDrive then downloads a copy of all their files and renames the existing files with the hosts name as a suffix. I can then delete all those files with the hosts name suffix and the remaining files are accessible.
Am I doing something wrong? Is there a better way to reducce the size of the VHDX without potentialy losing the users data?
Thanks
For anyone running into the same problem I would advise using diskpart to compress your VHDX files. Just run the following from an elevated command prompt.
select vdisk file=\\path\to\file.vhdx
attach vdisk readonly
compact vdisk
detach vdisk