Worklet to Remove User Profiles

  • 8 August 2023
  • 1 reply


My Helpdesk team is encountering an issue in our Warehouse where multiple users will sign into a PC and fill up the disk space seemlingly overnight.

I need a worklet that will evaluate the disk space on a shared PC and then delete user profiles that haven’t been modified or used in over 30 days if that disk exceeds 50%. I would also like it to also run disk cleanup every night.

1 reply

Userlevel 2

Hi @dwseckman12,


I wanted to let you know that we now have a Catalog Worklet for cleaning up dormant user profiles!

You can check it out here: Windows - Maintenance Tasks - Remove Old User Profiles


Be sure to read through the worklet’s help section to ensure you understand how to properly implement the worklet. And test, test, test(!) before rolling out to your production environment!


By default, the worklet will clean up unused profiles older than 30 days, but you can change the $ageLimit variable to specify your needs.  There is also an optional commented out $whitelistedUsers variable that can be defined if you would like to exclude certain profiles from the clean up (administrator, VIP,  or service accounts for example).

Have a great day!