FSLogix / Invoke-FslShrinkDisk

This script will shrink a FSLogix Disk to its minimum possible size
MIT License
155 stars 55 forks source link

VHDX not shrinking after deleting Teams folder #61

Open Hoppers69 opened 3 months ago

Hoppers69 commented 3 months ago

Hi, Firstly big thank you for the script.

Generally the script is running fine and we script to run over 8000 profiles.

We recently had a review on our disk space capacity and have investigated to redirect the Team (new) using the redirection file. During this process we discovered the old Team folder was still present and taking up on average 1GB per user.

We had a script to run through each vhdx, mount the vhdx, delete the folders: AppData\Local\Microsoft\Teams AppData\Roaming\Microsoft\Teams

We then run FSLShrinkDisk and gained back the majority of the space. One thing we did notice is that we had to run the FSLShrinkDisk script 2 or 3 times before the disk stopped shrinkin i.e. it might shrink .3gb then .7gb, then .1gb

We then decided to perform the same on \AppData\Local\Packages\MSTeams_8wekyb3d8bbwe

First we added \AppData\Local\Packages\MSTeams_8wekyb3d8bbwe to the redirection.xml. With testing, all works fine, but with an acceptable delay on start up of Teams new.

Then we followed the same process as above to shrink the disk however no matter how many times i run the script the shrink does not work

Running on a 2022 Server. Tried with Mapped drive and direct UNC path

Any idea why shrinking is not longer working ?

Thanks

Hoppers69

Exploer size on Disk Result from script run Shrink size from DiskMgmt Treesize on mounted profile

As a side note i think having a option to delete folders maybe using the Redirection.xml would be a big help.

PyroSoul630 commented 2 months ago

I used to have similar issues with this shrink tool and made some modifications. no issues in 100's of user profile shrinks. Maybe this will help you.

https://github.com/PyroSoul630/FslShrinkDisk-2024/tree/master

Hoppers69 commented 2 months ago

Thank you. Will give it a try