After messing with my Hosts File Updater script, I decided it needed an update. We’ve been messing with WPF and Powershell for a while now, and this would make the perfect candidate to showcase some WPF and runspaces.
We’ve recently been toying around with building a GUI for some of our web deployment functions, and naturally the project evolved over time. It started with building a UI in WPF, evolved to runspaces for performance gains, and finally ended at runspace pools for throttling. Through these evolutions, I’ve gained a considerable amount of knowledge in what can be done with Powershell.
Remove Windows 10 Bloat
While updating our Windows 10 images to the anniversary update (1607), I noticed that all the bloat I had already removed was added back. So I took this opportunity to brush up on some more Powershell and create a script that could help some other folks with the same issue!
Compress Files By Month
This script has found itself being used for many other purposes than originally intended, not sure why it has taken me so long to post it! It was written to provide for an easy way to zip all of our IIS logs, and have them grouped by month created. It was originally setup to append .zip files with new data as needed but ,due to a bug in the write-zip cmdlet, I have changed it to ignore the last month of logs. I will leave the commented out code in this script, just in case they eventually fix the bug.
Our employee termination process involves several steps. While they don’t take too long to run through individually, time IS precious! Here is a script that I wrote to automate the majority of the tasks that we perform when someone chooses to leave RANDA. There’s even a fun “Finished” notification to make the painful process of someone leaving a bit more light hearted.
Remove All Office 365 Licenses
I recently began writing a script to automate tasks when an employee decides to leave RANDA, I may post it in its entirety at a later date. In doing so, I searched for a way to remove all Office 365 licenses assigned to a user. I could find nothing… So I came up with my own!
In a previous article I discussed my need for instant gratification when it comes to replicating my DC’s. I gave an example of a script that would replicate all the DC’s that are manually programmed into it.
Well, here is a solution that will find the DC’s on its own and then update each DC with its respective partner. A much simpler and elegant solution if I do say so myself!
Remote Group Policy Update
So with the introduction of Server 2012, we now have the option of remote Group Policy updates! This can be accomplished using the Group Policy Management Console – Right click on an OU and choose “Group Policy Update…”. However, this method creates a scheduled task for the update that is set to run at a random time within 10 minutes. We need something a bit more immediate and fine grained!
Poll WMI Service
We recently encountered a situation where our monitoring server failed to report a critical event for a production server. We found that the issue was caused by the WMI service being in a hung state. Had the service been in a failed state, the monitor would have alerted us to that fact and we would have acted accordingly. This created a need to monitor the WMI service for these rare cases. The below script was my solution to this. I’m sure there are many areas of improvement to be made, for right now it works!