FSLogix Containers Cleanup Script

Published by Jeroen Tielen on

When you have a share with FSLogix containers you probably want to keep this in sync with you active directory. Users who are deleted, inactive or disabled can still claim space on the file server. This script will read all container folders and match them against the active directory useraccounts and delete the containers if needed.

All information is in the script.  Have fun with it and leave a comment when using or when having issues.

Keep in mind, I’m not a scripter/devver 😉 So the script can be shorter/smarter but this works either. I’m not responsable for any damage or deleted containers 😉 Usage of the script is your own responsability.


Jeroen Tielen

Experienced Consultant/Architect with a demonstrated history of working in the information technology and services industry. Skilled in Citrix, Microsoft, VMware, Ivanti, etc.

5 Comments

Joep · August 10, 2022 at 15:46

Hi Jeroen,

Thank you for this script. We are not using FSLogix Flip Flop, but I can’t figure out what to change about the script to make it work. Could you help me with this?

Kind regards,
Joep

    Jeroen Tielen · August 10, 2022 at 15:54

    Ahh you are the one in a thousand which is not using flip flop 😉 You need to change the script so it reads the username from the last part of the foldername. I never ever use that kind of naming convention as it is not easy to find the user his profile.

Tom Schoen · November 2, 2022 at 15:29

Thanks for the inspiration! Did not exactly use yours but served as a great basis to develop my own. Should it help you, you can find it here! I built a flipflop switch into it as well.

https://github.com/tompatta/PowerShell/tree/main/FSLogix%20Cleanup

    Jeroen Tielen · November 9, 2022 at 13:47

    Ahh lovely Tom. That is community power. Thanks for sharing.

Automatically clean up FSLogix Profile Containers – The Cloud Admin · November 9, 2022 at 19:24

[…] Jeroen Tielen created a cool script that does some of the things I wanted it to do, but not all of it. […]

Leave a Reply

Avatar placeholder

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: