Welcome to Matts Admin tips. This blog is full of little fixes, tutorials and work-arounds to those anoying problems that a Systems Administrator might face. If you find something that you have found useful please leave me a comment - I appreciate knowing that I've helped! Also, feel free to leave a comment if my tips or ideas don't work in your environment... I monitor them closely and would be happy to help! Matt

PowerShell: Remove Files based on date

I’ve had the need to remove a bunch of differential backup images from my backup server for a short while now – and thought this was the perfect opportunity to crack into powershell. I’m going to post the script and run through the important parts: dir C:\BACKUP -recurse -exclude SERVER1,SERVER2,SERVER3,SERVER4,SERVER1.IMG,SERVER2.IMG,SERVER3.IMG,SERVER4.IMG,FileClean.PS1 | where { ((get-date)-$_.creationTime).days -ge [...]

Tags: , ,

Filed under:Uncategorized