Monday, January 31, 2011

Making Environment Variables Follow Users Around

Some Windows applications rely on System or User environment variables to provide a global configuration setting that is queried during application launch, or while the application is being used.  A common example of this is ADSKFLEX_LICENSE used by many Autodesk products.  There are others, such as those used by Oracle, and whatever.

Most of the time, users stick with an assigned computer and things are static and happy.  But when you have a user that moves around different computers, but you need a setting to follow them, then you may worry about scripting or registry hacks.  Fortunately, Group Policy Preferences makes this easier than blowing your nose.

There are more ways to map out how to apply settings (logically) than I have the time or patience to describe.  So for this example I'm going to pick one scenario: The dreaded Microsoft Certification Exam question format…

Your company, Stinkfist Inc., has two FlexLM license servers in the production AD environment: Server "A", which handles licensing for the bulk of production, and Server "B" which is isolated for R&D users only.  You gave up trying to figure out how to use an options file with feature sets to segment license pools within FlexLM because you drink too much and spend way too much time flirting with the cute receptionist. 

You get a call that senior R&D engineer, Duke LaCross, needs to travel from office to office, but can't bring his laptop on the trip because he's concerned about it being confiscated for all the porn files he's collected.  So he needs you to figure out a way to make it so where he goes, when he launches AutoCAD, it pulls a license from server "B".  But if anyone else gets back on the computer, it pulls from Server "A".

You hang up, dash over to 7-11 and buy a canned energy drink, two 5-hour energy drinks, an apple pie, and a bottle of water.  You get back, sit down, consume all of these items at once, and now you need to devise a plan.  What do you do?

Answer: (choose one)

A) You slip a $50 bill from your wallet and pay the intern next to you to figure it out.  If he makes it work, you take full credit.  If it fails, what the hell?  He's an intern, and therefore replaceable.

B) You tell Duke to shove it.

C) You open up Group Policy Management Console, create a new GPO, configure the Preferences to assign a user environment variable "ADSKFLEX_LICENSE=@ServerB" if the user is a member of the "Obnoxious R&D Users" group, but assign it "@ServerA" if not in that group.  You know that in order to do this, you employ the "Item Level Targeting" feature of the Group Policy Preference and filter it based on Group membership.

D) A and B and then you go drinking because it's nice outside today.

I hope you picked C.

Post a Comment