You are using an ad blocker that is interfering with our web typography and internal javascript. Please whitelist our domain to live in a more beautiful world. No ads here, just really great software!

Disk Cleanup

Remove unnecessary files such as temporary, cached or deleted, memory dumps and unused user profiles from devices.

Description

System Cleanup includes cleanup of WinSxS folder, SCCM cache based on provided file age, and unused user profiles based on provided profile last use time.Interactive User Cleanup includes content removal of user temporary folder and recycle bin.

Script Disk Cleanup

  • Version 3.0.0.0 – Fixed issue affecting deep cleanup. Added input parameter ‘RemoveFilesOlderThanDays’ and ‘MaximumDelayInSeconds’
  • Version 2.0.0.0 – Added campaign to notify about completion of cleanup. Code refactoring. Removed Windows 8.1 support
  • Version 1.0.0.0 – Initial release

Script Description

An assisted-help campaign is triggered to perform a light (recycle bin) or a deep (recycle bin and user temporary files) clean.

Execution context and suggested scheduling

Run the script manually as interactive user.

Parameters

ID Label Description
1 Disk Cleanup Campaign Id UID of the campaign to allow the user select which cleanup process will be done
2 Cleanup Completed Campaign Id UID of the campaign to notify the user about the finish of the cleanup process
3 Remove Files Older Than Days Files accessed less recently than this threshold will be deleted. Provide number of days
4 Maximum Delay In Seconds Maximum random delay set to avoid overloading server hosting virtual machines. Provide number of seconds less than 600

Outputs

ID Label Type Description
1 Cleanup Space Size Space freed

Further Information

All files inside user temporary folder whose last access time is older than ‘RemoveFilesOlderThanDays’ input parameter, will be removed if deep cleanup option is selected in the campaign. Please note that LastAccessTime could be disabled by default in NTFS. If so, LastWriteTime will be used instead. Parameter ‘MaximumDelayInSeconds’ can be used to add random script execution delay. It should be used in virtualized environments to spread over time number of I/O requests on server hosting virtual machines.

Script System Cleanup

  • Version 2.0.2.0 – Bugfix for wrong SCCM cache path
  • Version 2.0.1.0 – Bugfix for user profiles with null LastUseTime property
  • Version 2.0.0.0 – Added SCCM cache cleanup and removal of unused user profiles
  • Version 1.0.0.0 – Initial release

Script Description

Performs WinSxS folder cleanup using DISM Windows tool, deletes SCCM cached files older than provided age in days, and removes user profiles unused for more than provided threshold in days.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 Maximum Delay In Seconds Maximum random delay set to avoid overloading server hosting virtual machines. Provide number of seconds less than 600
2 SCCM Cache Files Creation Age In Days File age threshold to delete Configuration Manager cache older or equal age. Provide 0 to ignore
3 User Profile Last Use Time In Days User profile age threshold to remove older or equal age. Provide 0 to ignore
4 Skip User Profiles List List of comma-separated profile names to be omitted. Provided names should be identical to user SAMAccountName Active Directory property. Special accounts are skipped by default

Outputs

None.

Further Information

Parameter ‘MaximumDelayInSeconds’ can be used to add random script execution delay. It should be used in virtualized environments to spread over time number of I/O requests on server hosting virtual machines.
SCCM cache cleanup does not work with Configuration Manager older than 2012.

Script Remove Memory Dump Files

  • Version 1.0.0.0 – Initial release

Script Description

The script removes all types of system memory dump files (small, kernel and full) older than provided number of days. The script is designed for Windows 10 and 7.

Execution context and suggested scheduling

Run the script manually as local system.

Parameters

ID Label Description
1 Remove Files Older Than Days Files older than this threshold will be deleted. Provide number of days
2 Maximum Delay In Seconds Maximum random delay set to avoid server overload. Provide number of seconds less than 600

Outputs

None.

Further Information

Parameter ‘MaximumDelayInSeconds’ can be used to add random script execution delay. It should be used on servers hosting virtual machines to spread the number of I/O requests over time.

Restrictions

  • The script is designed to remove memory dumps only from default locations (%SystemRoot%\MEMORY.DMP and %SystemRoot%\Minidump).

Content

Campaigns
Remote Actions

Required Modules

Nexthink Act
Nexthink Engage

Platforms

Windows

Compatibility

V6.14 and later
Thank you!