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… Read more

Changing Company Wide AD mapped Home Drives

This is a quick and easy way to change all of your users mapped home drives without manually editing every user. This is really helpful if your migrating to a new file server. dsquery user “OU=XYZStaff,OU=XYZOU2,OU=XYZOU1,dc=XYZCorp,dc=local” | dsmod user -hmdrv Z -hmdir \XYZ-FileServerStaff$USERNAME$ Simply, the dsquery grabs all of the user accounts in the XYZStaff… Read more

Audit User Logon and Logoff

A quick and easy way to audit your users login times (and some other details) is by using this simple login script method. Firstly, you need to build two .BAT file scripts and save them to some sort of Audit share on a server. (I suggest hiding the share with the $ so users can’t… Read more

Deploying Office 2007 Compatibility pack via Group Policy

Since Microsoft released 2007 and the new .*x file format there have been some compatibility problems – sure you can save your documents in the “old” 2003 format – but you loose some of the extra functionality available for 2007 users. Microsoft released an installer to resolve these problems allowing 2003 users to open 2007… Read more