First, let me forewarn you that this post is not even remotely technical in nature.  I have had a couple of significant events happening int he background that have been my priority over the past couple of weeks and wanted to give an update here on why things have been stale (if that’s even possible with only one technical post).

Change #1 – New Daughter

That’s right, on 5/23 my second daughter, Lydia Joy, was born around 8:30 AM.  Everything went as smooth as possible and like many others before me, this week has been a week of settling in and adjusting to the demanding schedule that a newborn requires.  This time around was a lot easier from a preparation standpoint as we already had all of the necessities from our first.  That being said, my wife and I took the more traditional route and didn’t know the gender before birth.  I guess we lucked out as their was no required mad rush to the store to buy boys clothing.  I’m enjoying the process a little more this time as it is familiar and couldn’t be more excited that Hannah (our first) wants nothing more than to be a great helper.  I’ll spare you any more details and just post the picture like any proud father should:

Change #2 – New Job

After 6 years at my current employer, KidsPeace, I have decided that the timing is right to pursue new opportunities elsewhere.  I am extremely grateful for the opportunities I’ve had while working at KidsPeace and am excited to bring the experience I have gained there to new projects and challenges.  As I’m sure you can imagine, the past two weeks have been daunting with transitioning current responsibilities to my team members and having a baby during the process.  It certainly has not been boring and am glad that the bulk of the craziness is done for a while.  I will be joining the systems team at kgb starting tomorrow which I’m sure will bring a bevy of new topics to cover on this blog.  I am still planning on pursuing my CCNP (even though it falls out of the purview of my new responsibilities) and even possibly VCP in the near future as virtualization will be a large component of my position.

 

So now that the news is out of the way, I promise that my next post will be a technical one.  Until then…

Recently I had an interesting problem that arose regarding a rollout of Citrix Receiver to all corporate computers.  The issue was that the rollout was going to be done by subnet (a limitation introduced by the thin clients in use) and not by some of the other typical grouping logic that has been used in the past.  Due to the problem that our users are not administrators of their machines, we could not just ask them to install the software themselves.  Additionally, since our OUs do not mimic our subnet structure, this created and issue when doing an application push to everyone using group policy.

So what I needed to find was a way to apply an installation script to all computer accounts that only executed the install if your computer was a member of one of the targeted subnets.  I had batch scripting and vbscript as options as this was being done through Active Directory and powershell is not installed on most workstations.  Here’s are the scripts that ended up accomplishing the task:

Script 1: receiver-install.bat

Script 2: receiver-install-2.bat

File 1: subnets.txt

So let’s break this down a bit and look at what is actually happening…

First, an Active Directory GPO is applied to the top level of your computers OU that executes receiver-install.bat.  Since our users are not administrators, we did this as a computer startup script since that is run as the SYSTEM user.  If your users have installation privileges this could just as easily be applied as a login script for the user using loopback processing of group policy objects.

Once the script is running as an administrator, it reads a file named subnets.txt line by line.  This file should be maintained on a central file share and will be the file used to control which subnets are targeted for installation.  Each line of the subnets.txt file is read into a variable and then receiver-install-2.bat is called with that subnet as an argument.

Here is where things get interesting.  We need to verify that the machine is currently a member of one of the target subnets using only commands available to us in batch scripting.  Here is where a little command line kung-fu can help.  Most of us know that issuing the ipconfig command will list out all of the IP addresses a machine is currently using.  This command also give us quite a bit of additional information that isn’t required for our purposes.

ipconfig output

In order to pare this down we’re going to use the pipe (|) and the find command to identify the line we are looking for.  The actual command in the script looks like this:  ipconfig | find /i “IPv4 Address”  An output of that command is in the window below:

“IPv4 Address” is specific to Vista and Windows 7 machines so we also check for “IP Address” which is the heading used by 2000/XP machines as well.  We then run another find against the line that is returned and if we find that the subnet matches the one used in calling the script we continue to the installation portion.  Otherwise we gracefully exit the script and try the next subnet.

From here on out anything can be placed in the installation portion of the script.  As stated above, we were using the script to install receiver.  We run a couple of checks to see if it is already installed, and if it isn’t, we run the installation.

I hope this can help some of you who may find yourself in a similar situation.  I’m sure there are far more graceful and elegant ways to handle this specific scenario and I would love to hear them if you have them.

 

Welcome to the start of my personal blog.  Regardless how you made your way here, welcome and I hope that you find the content here useful.  Let me take a minute to introduce myself:

My name is Jordan Martin.  I am currently the Manager of Technical Services at a national non-profit organization serving behaviorally challenged youth.  I have 10 years of experience in managing networks and systems and have had the opportunity to manage my fair share of enterprise technology.

When I’m not at work I’m usually spending time with my beautiful wife and daughter.  We are expecting child #2 any day now and are very much looking forward to meeting them soon.

She's definitely a daddy's girl...

She's definitely a daddy's girl...

I’m starting this blog with the hope of giving back to the community that has given me so much.  I plan to write about the technologies, techniques and general news that I run across while doing my job.  My hope is to help others and to join in on the amazing community that surrounds the technologies we manage.  Comments and feedback are greatly appreciated and I would love to hear what all of you would like to read about.