PowerShell – and how to add new DNS servers to remote systems

Well, I’ve been playing around with PowerShell today. I had the task to move (as in change the IP address) two domain controllers into another VLAN. I could have done it the easy way and added the DNS servers by hand (by RDP’ing to each system having these particular DNS servers configured) – which wouldn’t have been very hard considering the domain only has 7 members at this point …

I wanted to do it the proper way, so I ended up asking old uncle Google, and it supplied me with the answers I was looking for.

Now, I executed those few PowerShell lines before changing the IP address of both domain controllers ( being the old IP and being the new one). After that I changed the IP address on the second (and after a short downtime) on the first domain controller. After both were restored and available again (and I checked with repadmin /showrepl), I ran the script again, this time only setting the new DCs:

Well, considering the time I spent on looking for this and the time I would have needed to change even the seven members – even this is a time saver.

Implementing SnapVault backups – the hard way

Well, I recently had the pleasant task of implementing SnapVault backups, that are being shipped to an offsite location with SnapMirror.

That in itself isn’t the bad thing, however we decided against Protection Manager (since it was a charged product back when we decided on this). So I basically had the three tasks:

  1. Actually implement the SnapVault stuff (and learn my way around it and also document it)
  2. Write a bunch of scripts, that help us in creating scheduled backups of our databases
  3. Create a monitoring script, that’ll fit into our Nagios environment already in place

Well, two months later (sadly it still has some kinks – I can’t figure out this one bug though for the life of it) and a few hundred hours of working on/with it and out came four things:

  1. Bash-scripts to create the SnapVault/SnapMirror relations
  2. Powershell scripts to trigger the SnapVault updates
  3. a Nagios plugin, based on NetApp’s SDK for Data ONTAP (even if the API is crap from time to time – it’s still better than using SNMP)

I’ll post those things one after another, once I wrote up all the articles.

PowerShell brush for jQuery.Syntax

As you might have noticed, I’m using jQuery.Syntax as my Syntax Highlighting engine. As I recently started writing PowerShell scripts, I wanted syntax hightlighting for it.

Since I knew, someone already wrote syntax highlighting for GeSHi for PowerShell (I am lazy after all!), I simply took the color scheme (shame on me), and made hacked ahead. After about three hours (yeah, I had some trouble with editing the wrong damn file), I came up with this:

You’ll also need the fitting cascading style sheet for this:

I was also trying to create an “addon language” for PowerShell, PowerCLI. But that didn’t work right and I guess I’ll have to talk to the guy writing jQuery.Syntax on how to properly use Syntax.brushes.dependency.