We have migrated from Windows XP to Windows 7 at a high school and have run into a problem. The computer lab machines can have upwards of 5-10 different people log into the machine each day. As time goes on, the local cache of user accounts fills up the small hard drives we have. We don't have money to upgrade so we need to find a way to delete the profiles monthly.
In the past we have used delprof from microsoft which worked great. The problem is that delprof doesn't work for windows 7. Does anyone have a way to delete a profile from a batch/powershell script? If you simple delete the files, you get an error the next time the user logs in.
Thanks in advance
wmic path win32_userprofile where special!=true delete
or the VBScript/PowerShell equivalent with the necessary WMI calls. Thespecial
parameter is redundant, since it will fail to delete special profiles (default profile, NetworkService, LocalService, etc.). If you log output, it will cut down on noise.With PowerShell, I believe this will work.
Haven't tested as don't have Windows 7 or Vista box to work with.
How about using the method built into Windows instead of trying to script this? Just create group policy using the following setting.
I have written an inofficial successor to Delprof creatively called Delprof2. It works on all versions of Windows (XP/Vista/7/2003/2008/2008 R2), is syntax-compatible to the original and even more powerful.
Delprof2 is free to use commercially or otherwise.
More information and download: http://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/
Delprof2 of Helge Klein is a wonderful tool for removing user profiles. I tried on Windows 7 and it removed those user profiles settings in registry too. Delprof2 is very simple to use. Merci Helge Klein.
How many machines are you dealing with? If it's not too many, perhaps it might be feasible to remove the profiles using a script or manually using the system properties panel (see screenshot). Once the system is at a "clean" state, you can use a reboot to restore software to clear out any changes made at a specified time. One such product is Deep Freeze by Faronics.
http://www.faronics.com/en/Products/DeepFreeze/DeepFreezeCorporate.aspx
If you're not familiar with it, the way it works is that you have a workstation installer that runs on client machines that talks to an admin console. The console can even run on your computer and you can quickly perform actions on multiple machines such as reboot, reboot frozen (no changes are saved), reboot thawed (the reverse). You can create events for all the machines as well e.g. restart at x time etc. It also has support for WSUS.
If you image the machines, you can have a second piece of software called a seed that you install on the image. Once the new machine is configured, it serves as a beacon and talks to the console. That enables you to launch the full workstation install without even needing to walk to the client computer. On the user end, it appears as if they can make changes, but once it restarts, everything is gone.