Server-OS-Drive-Cleanup-Script
Server-OS-Drive-Cleanup-Script copied to clipboard
Server-OS-Drive-Cleanup-Script
Script Information
Created Date - 12/5/2016
Last Updated - 12/14/2016
Version - 3.0
Created By - Phillip Marshall
Script Pre-requisites
- Powershell should be run as admin when this script is executed.
Script Process
- Prompts the user for the computer name to run the script against (or you can just enter nothing for local host).
- Tests PS Remoting against that server to verify the user has access.
- Gathers the current free space on the C drive.
- Cleans all temp paths.
- Gathers all user profiles.
- Cleans each user profile's temp and downloads folder.
- Tests for and cleans old Symantec virus definitions. (The old folders still stay they do not appear to be removeable.)
- Runs CleanMGR
- Runs DISM
- Removes any IIS logs older than 30 days for any website.
- Removes unnecessary windows update files.
- Cleans all items older than x days from the recycle bin. (Default of 7)