Windows – Delete cached copies of roaming profiles older than x days

roaming-profilewindowswindows 7windows-server-2008

Several of our workstations are shared between multiple (30+) users. Every time one of them logs off, a cached copy of their user profile remains on the computer's hard disk. This is convenient and intentional – however, after a couple of months I'd really love for unused profiles to be deleted automatically.

There are 2 GPOs each doing half of what I'd like to achieve: There's "Delete cached copies of roaming profiles", which immediately deletes roaming profiles after logging off, and there's "Delete user profiles older than a specified number of days on system restart" – unfortunately this also applies to local profiles (which is undesired).

Is there a way to delete cached copies of roaming profiles after a certain period of not being used?

Best Answer

You can easily create a GPO that creates a scheduled task on these computers.
In these task (which you'd probably want to run daily), simply run delprof2 with "/r" for roaming profiles and "/d" for the days you want it to stay.
You can do a test with "/l" and see what profiles you get back.