Showing posts with label Server Administration. Show all posts
Showing posts with label Server Administration. Show all posts

Wednesday, January 30, 2013

Powershell Script to Delete Out Temporary Internet Files

If you have a lot of user profiles on a box, the user profiles can start to take up a lot of disk space. This is especially so on a Citrix or terminal services server, but can affect any system where more than a few people logon. I wrote a quick powershell script that can be scheduled to clean these out.


IIS Log Management Script in Powershell

IIS logs on a busy webserver can use up a lot of disk space. I wrote this little powershell script that I schedule to run on all of my web servers. It goes in and deletes out any IIS logs older than 1 year. Then it compresses any IIS logs that are left which are older than 1 day and are not already compressed. You can change the length of time for these to suit your needs by changeing the numbers in the "AddDays(-123)" parts of the script. Just make sure it's a negative number, or else you won't have any logs left.