SSH for Windows (Kinda)

Soooo, you’re using your windows environment and you’re getting kind of sad about how you can’t really SSH into your boxes any more and don’t want to use the clunky GUI and such….

Well, let me introduce you to a few neat little (And rather unknown??) Powershell cmdlets.


What do PSSessions allow you to do? Run code on a remote machine. Simple as that.

If you’re having issues enabling it, make sure you have PSRemoting enabled. If not, you can enable it with the following


Windows 8 & Exchange Management Console Fix

So you’ve just installed/upgraded to Windows 8 and errrmahhgerdd Metro UI is so cool, you then go to open exchange MMC and notice half it’s not working.

After a little research (Googling is hard) I found the following batch file will help you launch a fully functional Exchange MMC on Win 8

If you’ve installed the MMC in a different directory then you’ll have to change the start path.

Short, sweet and I should post more stuff.

Adding Domain/Sender to White list in Exchange 2010

Real simple one, but it’s something which can’t be done from the GUI from what I can see…

To view what currently is in the White List for senders, fire open the Exchange Management Powershell err shell.

And enter the following for induvidual e-mail address:


And the following for white listed domains:


Now to add something to either of these!

To whitelist a domain e.g. you’d do the this:

$WhiteDomain = (Get-ContentFilterConfig).BypassedSenderDomains


Set-ContentFilterConfig -BypassedSenderDomains $WhiteDomain

And to Whitelist a sender e.g. you’d do this:

$WhiteSender = (Get-ContentFilterConfig).BypassedSenders


Set-ContentFilterConfig -BypassedSenders $WhiteSender

Once you’ve done that, go ahead and confirm your changes by viewing the Bypassed Sender lists using the commands at the start of this post.

Ninite Automation – With E-Mail Confirmation + Logging!

I’ve had quite a bit of communication about how the AutoNinite script I wrote quite some time ago, and there were some features in it which I actually wasn’t happy about it.

So here I am with my latest version, it can be viewed over on GitHub @

There are still a few features I want to build into it, such as not having a user have to edit so many variables, altering the report generated with some colour coding,

If you’re looking to run this as a scheduled task, I’ve also included a batch file to call the PowerShell script for a windows server.

Just simply create a new scheduled task, have it re-occur every day at a certain time and hook it up to the NiniteOne.bat packaged.

But really, please test this in your environments before going crazy and remember… YOU MUST SET THE VARIABLES TO BE SPECIFIC TO YOUR ENVIRONMENT

Hopefully, this will be helpful to some people, it’s currently what is powering the software updates within my own organization.

For more “detailed” instructions on how to use it, they can be viewed here:

If you have any questions, leave a comment or email me at blog[at]

How to Prestage a VMWare VM in Windows AD via PowerCLI

Recently when working on our deployment of machines, we hit a few brick walls.

The main issue was how long it takes for a template from vSphere to be cloned, then join a domain. The delay is whilst you wait for the machine to Sysprep and VMWare to do its magic.

At first, I was dirty and put a delay in our creation scripts before doing anything else to the machine, but this just didn’t cut it.

So, I moved on to pre-staging the VM in our Windows AD, which meant things such as Group Policies and Security Groups would be applied on its very first boot which meant one less reboot before our virtual machines were ready to have applications deployed to them.

Here’s the function which can perform said wizardry… it’s pretty simple but doesn’t seem to be very well documented anyplace.

HAProxy – HTTP 500s Out Of The Blue – Fixed

So this morning we faced a few interesting issues revolving around our HAProxy setup.

The scenario we faced was HAProxy reporting all our servers as down, despite them being perfectly accessible directly (i.e. not through the load balanced IP)

And thus the process of elimination began;

  • Firewall Issue – Nope
  • AV Upgrade – Nah
  • Changes in the web applications – Ney

I have to admit, we were pretty stumped. Our Icinga (Nagios fork) check_http checks were going through fine, when we duplicated checks to the servers they were also fine and reporting a normal 200 status.

Looking at the checks, it was reporting an issue with our mobile site (Currently in development) so we added in an agent-type to the HAProxy httpchk, still no dice.

After more prodding and poking and a big hint from vr (@vihaire) I added in a host header and as if by magic, the sun came out from behind the clouds and shone its delightful rays upon us.

The config used was the following;

So if you run into this issue, then this may just be the fix to your problems!

A nice little article on Host Headers and IIS @

Automating Software Deployment /w Ninite – Improved!

It wasn’t so long ago that I wrote this article;

It seemed quite well received, I actually had some tweets and messages about it :O!

Now, two weeks ago I came across the following post on Reddit;

Ninite Pro. There’s a powershell script on a Spiceworks forum that pulls all machines from AD, as the Ninite machine scan leaves a lot to be desired.

Really I thought? I best go check that out!

The scripts in mention are the following;

Just thought I’d point these out in a great upbeat passive-aggressive manner.

Imitation is the best form of flattery

Anyway, moving on swiftly!

What this post really is about, an improved version

So that’s what I worked on tonight whilst upgrading our AV systems.

So this is single PowerShell file, it has the following Pre-requisites;

  • It must be in the same folder as NiniteOne.exe
  • You have to set the variables and paths beforehand

As for where I’d like to take this script

  • E-Mail of the logs, in a more legible format
  • E-Mail of outstanding needed software
  • Possible input of parameters rather than setting variables

Rather than writing a new blog post for when I push one of these features, you’ll be able to follow them over at GitHub @ 

Syncing Sublime Text 2 with Google Drive

So Google Drive, pretty cool eh? It seems nice so far!

Something I’ve found myself doing is using it sync my Sublime Text 2 files I’m working on, but I figure I can go one better and sync my Sublime Text 2 settings to create a seamless environment to work in.

I just have to say, if you’ve not tried Sublime Text 2 out, I really… really think you should! It’s pretty damn awesome, so awesome here’s a link.

Now down to business;

First thing first, install Google Drive over @

Now for the steps;

  • Map your gDrive to a drive letter using methods here;
  • Create a new folder in your gDrive, call it Sublime
  • Open up a windows browser and head on over to %APPDATA%Sublime Text 2
  • Move all the folders from here to your shiny new folder in your gDrive (There should be 5 folders, Backup, Installed Packages, Packages, Pristine Packages, Settings)
  • Make a backup of the %APPDATA%Sublime Text 2 directory and then delete the folders that sit in it.

Okie Doke, now it’s time to use mklink. Fire up a cmd prompt (As an administrator -_-)

And here goes, you’ll want to alter C:\Users\fen\Google Drive to your gDrive’s drive letter (e.g. Y:), then the magical mklink will create a link to your gDrive so that Sublime Text 2 will use the config files you just moved~!

Drum roll please, that’s that over and done with.

This method could be used by quite a few programs I’m sure.

Run Powershell from a Network share – A Cheeky Bypass

There is a backstory for this which will be saved for a later post, but this is too good to not share.

So, say for example you have a script which isn’t signed (Ahem!) and you’re wanting to run it from a UNC path (Network Share)

If you try and do this, it’ll throw up a security error.

But to bypass this, you simply have to call it from a batch file something similar to this

This will then bypass any issues you have, and it’s for a one time use so you don’t have to change the ExecutionPolicy within Powershell.

Hope this helps some guys out there trying to run certain scripts on Logon (Or scheduled tasks!)

Icinga – Scalable and Manageable configuration

So, over the past days, I’ve overcome quite a few hurdles in getting Icinga up and running, configured with windows hosts and such.

As part of the process, I’ve rolled back the VM time and time again just to understand exactly what is going on with it all and not blindly following a guide.

I’m now at a point where I’m happy and deciding how to complete the rest of the setup and deployment.

Now, if you’ve ever set up Nagios or Icinga, you’ll know the configuration files can be quite messy to a novice (And some of the vets at times I imagine!)

So, whilst I may know the system… it’d make no logical sense to anyone else I work with, or if I were to be struck by lightning, my less-cool replacement.

To counter this, I gave some thought of how to arrange stuff within’ Icinga, after some google-fu I came across a post by Matt Simmons which really hit the nail on the head as far as I’m concerned see;

So this is the result, and by far no means finalized work in progress for how our Icinga directory will end up looking;

  • Hostgroups
    • App-Servers
    • SQL-Servers
    • Windows-Servers
    • HAProxy-Servers
    • Linux-Servers
    • VMWareHosts
  • Objects
    • Commands
    • Computers
      • Windows
      • Linux
    • Network
      • Firewall
      • Switches
      • Routers
      • VPN Links
    • ESX Hosts
    • Misc
  • Services
    • WindowsServices
    • LinuxServices
    • VMWareServices
    • SQLServices
    • HAProxyServices
    • AppServices
    • DefaultServices
  • Templates
  • Modules
  • Stylesheets

These are a little generic names, they’ll be altered for our environment to match as much structure as possible that we have elsewhere e.g. Windows Security groups, AV groups, folders on our VMWare Datacenter etc.

But, by abusing hostgroups… it should be possible to “configure” a machine by simply creating its own host file (w00t!)

I’ll also be looking to streamline some of the following post into our config as well;

Once this is done and dusted, everything is populated… The next task will be trying to automate the addition of hosts~!