We are trying to accomplish some basic system maintenance with BigFix. We’d like to be able to do two things which are fairly easy to do in vbscript or powershell. The question we have is has anyone done it in BigFix?
Task 1: Delete User Profiles older than a specific age
We are looking to do more than just a file / folder delete. We want to removed the associated registry entries just like what would happen if you went to My Computer | System Properties | User Profiles | Settings and deleted them from there. The registry key where they are kept is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. This is also how the resource kit DELPROF tool works, but it’s not as flexible as we need it to be.
Task 2: Delete all files in ALL temp folders on the system.
So this would include %windir%\temp, along with every %temp% path for each user profile on the machine. Normally only the currently loaded profile will have its temp files deleted. So it needs to enumerate all the profile folders under “Documents and Settings” or “Users” and clean out the files in the temp directories under there as well.
So if anyone has done something similar in BigFix and you could share it, even if it is just recursive directory functionality, I’d owe ya!
Were you ever able to figure this out. I too would like to schedule some automated cleanup tasks with BigFix, like deleting temp files and old profiles, as well as maybe scheduling a defrag to run after hours on PCs.
We ended up with a vb script for the temp files and delprof for the profiles - The only problem with the vbscript is when it encounters a file it can’t delete - so we just trap for errors and move on, not the best logic and it doesn;t completely clean the temp directory, but it’s pretty good at getting most items:
Code
Set oFileSys = CreateObject(“Scripting.FileSystemObject”)
Set oWshShell = CreateObject(“WScript.Shell”)
Set oFolder = oFileSys.GetFolder(oWshShell.ExpandEnvironmentStrings("%TEMP%"))