ADSKFLEX_LICENSE_FILE Automation – Part 1 of 2

We encourage our clients to use the distributed license server model for Autodesk license management.  With the distributed model, you can distribute licenses to servers in different WAN locations.  For example, let’s say that you have ten AutoCAD licenses and three offices:  San Francisco, New York, and Cincinnati.  You could setup license servers with four, three, and three licenses assigned to SF, NY, and CIN respectively.  The advantage of the distributed model is that if the WAN link ever goes down between SF and NY, a user can still access the licenses from the server on their own LAN.

If you distribute those 10 licenses, can you still share them?  Absolutely.  If the 4 licenses in NY are being used, a user in NY can get a license from SF.  How do you do that?  Use the ADSKFLEX_LICENSE_FILE environment variable.  And that’s what I would like to expand on in this post.

Often times, you need to change your distributed environment.  You may replace a license server, redistribute licenses, or open a new office.  Each time a change like this is made, the ADSKFLEX_LICENSE_FILE environment variable must be updated.  What if you have to do this on 100 computers?  How can you automate this process?

First create a notepad document entitled adsk_lm.vbs.  You can name it whatever you like as long as it has the vbs extension (VBScript).  We’ll be creating a VBScript to set the ADSKFLEX_LICENSE_FILE environment variable:

The third line is the critical component.  We are setting the ADSKFLEX_LICENSE_FILE environment variable to the following:

@SFSERVER;@NYSERVER;@CINSERVER

These names should correspond to the server names in each of the three offices.  We are setting a system environment variable which may require local administrator privileges.  Alternatively, on line 2, you could set a user environment variable which doesn’t require local administrator privileges.

If you want to copy and paste the script text above, here it is:

[sourcecode language=”vb”]
Set WshShell = WScript.CreateObject("Wscript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
WshSysEnv("ADSKFLEX_LICENSE_FILE") = "@SFSERVER;@NYSERVER;@CINSERVER"
Set WshShell = Nothing
Set WshSysEnv = Nothing
[/sourcecode]

Once the VBScript file is created, how do you run it when a user logs on to his machine?  I’ll talk about this in part 2.

No Comments Yet

Leave a Reply

Your email address will not be published.

Back to blog

Copyright ©2017, CAD Masters, Inc.. All Rights Reserved.