Change ArcGIS Desktop license level and LM machines w/o Admin rights 10/11/2017

Document created by rastrauch Champion on Oct 11, 2017Last modified by rastrauch Champion on Oct 11, 2017
Version 2Show Document
  • View in full screen mode

WARNING...this process changes the REGISTRY which can cause issues if something is set incorrectly.  Review and test before deploying.  We have tested on several machines with ArcGIS 10.2-10.5.1, both physical machines and virtual, desktop win7 and MS Server 2008 and 2012(?).

 

This is to help others that are needing the same, but please take time to understand what it is doing, and modify for your organization as needed.

 

History and cause:  Over the past few years, our agency's IT have been working on tightening up security, which means removing the local admin permission for many users/user-machines (btw - helpful even for those with admin rights).  For ArcGIS, we have concurrent-use licenses that are divided between three license manager machines.  Each machine has a different configuration of available licenses. 

 

Issue: We have a very limited number of Advanced (ArcInfo) seats. When staff requires the advanced tools, they need to switch license levels, perform the work, then switch back to Basic.  Without admin rights, this takes two calls to our network services staff, which can cause inconvenience for both parties.  In a related situation, if a user needs to borrow a license for field work, they need to switch to a different license manager, which only has Basic, then switch back once the license is back and un-borrowed. Again, requiring two calls to network services.

 

Goal: Create an easy to use tool that staff can use to switch license level and/or license manager, without requiring admin rights.

 

Solution: There have been a handful of posts over the years with various suggestions, and I have adapted, merged, and researched more options, plus added a few checks.  The two tools are DOS .bat files (name them as mentioned below):

  • The  "Change.ArcLevel.bat" prompts the user to verify that ArcMap/Catalog are not currently running (could cause issues).  It then prompts the user to choose the level they want to set.  We do not have any Standard (ArcEditor) licenses, so although I offer that up as an option, I let them know that and then set it to Basic.
  • The "ChangeLicMgr.bat"  prompts the user to verify that ArcMap/Catalog are not currently running (could cause issues). Then has the user select one of the license manager connections (pool, borrow or gis-staff), setting the license level to Basic for the first 2 choices, and Advances for the gis-staff dedicated license manager.

 

Limitations or known quirks

  • These tools might not change what shows thru the ArcGIS Desktop Administrator but the registry seems to override what is shown there. 
  • We have had a couple cases that it doesn't appear to work, but running a second time works (a registry value may not have been populated yet).
  • Not tested for Pro concurrent licenses.

 

To use:  Save as .bat files (can save as .txt for editing purposes, then change to run).

  • for ChangeArcLevel, review and modify lines ~64-109, as needed, to reflect the Lic Level choices and info you would like the user to see (echo lines)
  • for ChangeLicMgr, review and modify lines ~104-148, as needed, to reflect the choices and info you would like the user to see (echo lines)

 

Possible future additions:  I would like to add a "uncheck all extensions" but haven't looked into that yet.

 

Sample ChangeArcLevel.bat   (fairly generic but the echo messages might not make sense for your org)

@ECHO OFF
cls   REM clears the cmd window
REM This tool requires SETX.exe (standard in windows 7 install)
REM Author: Rebecca Strauch 2017
REM
REM Key:
REM   ROOT :
REM    HKLM = HKey_Local_machine (default)
REM    HKCU = HKey_current_user
REM    HKU  = HKey_users
REM    HKCR = HKey_classes_root

REM Registry:
REM   location: HKCU\Environment
REM   keys: ARCGIS_LICENSE_FILE, ESRI_LICENSE_HOST, ESRI_LICENSE_SERVER, ESRI_SOFTWARE_CLASS
REM Registry location for environment variables:
REM   location: HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
REM   keys: LICENSE_SERVER    and maybe SOFTWARE_CLASS or SingleUse_Installed
REM 

setlocal ENABLEEXTENSIONS
REM "HKCU\Environment" stores the info from the vairables, etc.
set KEY_NAME="HKCU\Environment"
set REG_LL_NAME="ESRI_SOFTWARE_CLASS"
set VALUE_NAME1c="ESRI_LICENSE_SERVER"

REM  1)this FOR-IN-DO grab ESRI_SOFTWARE_CLASS key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v %REG_LL_NAME% 2^>nul`) DO (
    REM set LLName=%%A
    REM set LLType=%%B
    set LLValue=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_SERVER key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME1c% 2^>nul`) DO (
    set LMValue1c=%%C
)

echo   ******************************************************************
echo     PLEASE MAKE SURE ALL ARC- SOFTWARE IS CLOSED BEFORE PROCEEDING!
echo   ******************************************************************
set ok2run = ""
set /p ok2run=Verified Arc- software closed? (y/n):

if "%ok2run%" == "y" (
  set ok2run= Y
  if "ok2run%" == Y (
    echo If you see this, it is ready to run
     )
  )
if not %ok2run% == Y  (
  goto :DoNothing
  )

REM ESRI_SOFTWARE_CLASS is sys var; reg rules license level not available
echo.
echo   **************************************************************
echo      Current ESRI Software level: %LLValue%
echo      --------------------------------------------------------
echo      Current ESRI License Manager: %LMValue1c%
echo   **************************************************************
echo.

REM 1 - ArcView
REM 2 - Standard\ArcEditor- no adfg Editor level available, change to Viewer
REM 3 - ArcInfo - temporary use for pool users
echo   ..................................................
echo   Choose a software License level:
echo       1 - Basic\ArcView    (level=Viewer)      
echo       2 - ArcEditor        (not available)     
echo       3 - Advanced\ArcInfo (level=Professional)
echo.
echo       9 - Exit with no change
echo   ..................................................

:Start
echo.
REM set /p id="Enter a number (1-3 or 9 to exit): " %=%
set /p choice= Enter a number (1-3, or 9 to exit):
echo.

if '%choice%' == '' set choice=9
if %choice%==9 Goto :DoNothing

REM  Sets  variables for license type...if Editor, change to Viewer, based on users selection
if %choice%==1 (
     set class="Viewer"
     echo.
     echo    ***  Setting license level to Basic/ArcView.    ***
     echo.
)

if %choice%==2 (
     set class="Viewer"
     echo.
     echo    *** Note: We have no Standard level License  ***
     echo    ***  Setting license level to Basic/ArcView. ***
     echo.
)

if %choice%==3 (
     set class="Professional"
     echo.
     echo    ***  Setting Licence level to ArcInfo/Advanced ***
     echo    ***  Remember to change back to Basic          ***
     echo    ***      once Advanced task completed.         ***
     echo.
)

SETX ESRI_SOFTWARE_CLASS %class%     
SET  ESRI_SOFTWARE_CLASS %class%     

TIMEOUT 2

:DoNothing
echo.
echo. Exiting without making any changes
echo.

FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v %REG_LL_NAME% 2^>nul`) DO (
    REM set LLName=%%A
    REM set LLType=%%B
    set LLValue=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_SERVER key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME1c% 2^>nul`) DO (
    set LMValue1c=%%C
)

echo.
echo   **************************************************************
echo      Current ESRI Software level: %LLValue%
echo      --------------------------------------------------------
echo      Current ESRI License Manager: %LMValue1c%
echo   **************************************************************
echo.

echo Hit any key to close program...
pause

 

Sample ChangeLicMgr.bat   (modify echo for your org, and must include your @LMmachine in the "set server=" lines)

@ECHO OFF
cls   REM clears the cmd window
REM This tool requires SETX.exe (standard in windows 7 install)
REM author: Rebecca Strauch 2017
REM
REM Key:
REM   ROOT :
REM    HKLM = HKey_Local_machine (default)
REM    HKCU = HKey_current_user
REM    HKU  = HKey_users
REM    HKCR = HKey_classes_root

REM Registry:
REM   location: HKCU\Environment
REM   keys: ARCGIS_LICENSE_FILE, ESRI_LICENSE_HOST, ESRI_LICENSE_SERVER, ESRI_SOFTWARE_CLASS
REM Registry location for environment variables:
REM   location: HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
REM   keys: LICENSE_SERVER    and maybe SOFTWARE_CLASS or SingleUse_Installed
REM 

echo.
echo ***  This tool is used for switching to a different LICENSE MANAGER machine.
TIMEOUT 3

setlocal ENABLEEXTENSIONS
REM "HKCU\Environment" stores the info from the vairables, etc.
set KEY_NAME1="HKCU\Environment"
set VALUE_NAME1a="ARCGIS_LICENSE_FILE"
set VALUE_NAME1b="ESRI_LICENSE_HOST"
set VALUE_NAME1c="ESRI_LICENSE_SERVER"
set VALUE_NAME1d="ESRI_SOFTWARE_CLASS"

REM "HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3" stores info that is stored in ArcGIS Admin
set KEY_NAME2="HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3"
set VALUE_NAME2a="LICENSE_SERVER"
set VALUE_NAME2b="SOFTWARE_CLASS"

REM  1)this FOR-IN-DO grab ARCGIS_LICENSE_FILE key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1a% 2^>nul`) DO (
    REM left in 1st FOR-IN-DO to show how to get name and type. Removed from other FOR-IN-DOs to conserver space
    REM set LMName1a=%%A 
    REM set LMType1a=%%B
    set LMValue1a=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_HOST key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1b% 2^>nul`) DO (
    set LMValue1b=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_SERVER key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1c% 2^>nul`) DO (
    set LMValue1c=%%C
)

REM  1)this FOR-IN-DO grab ESRI_SOFTWARE_CLASS key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1d% 2^>nul`) DO (
    set LLValue1d=%%C
)

REM  1)this FOR-IN-DO grab LICENSE_SERVER key value from HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME2% /v %VALUE_NAME2a% 2^>nul`) DO (
    set LMValue2a=%%C
)

REM  1)this FOR-IN-DO grab LICENSE_SERVER key value from HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME2% /v %VALUE_NAME2b% 2^>nul`) DO (
    set LMValue2b=%%C
)

echo   ******************************************************************
echo     PLEASE MAKE SURE ALL ARC- SOFTWARE IS CLOSED BEFORE PROCEEDING!
echo   ******************************************************************
set ok2run = ""
set /p ok2run=Verified Arc- software closed? (y/n):

if "%ok2run%" == "y" (
  set ok2run= Y
  if "ok2run%" == Y (
    echo If you see this, it is ready to run
     )
  )
if not %ok2run% == Y  (
  goto :DoNothing
  )

echo.
echo   ***********************************************************************
echo      Current ESRI License Manager: %LMValue1a%
REM echo      Current ESRI License Manager from Registry:
REM echo        From %KEY_NAME1%:
REM echo          %VALUE_NAME1a% = %LMValue1a% 
REM echo          %VALUE_NAME1b% = %LMValue1b% 
REM echo          %VALUE_NAME1c% = %LMValue1c% 
REM echo        From %KEY_NAME2%:
REM echo          %VALUE_NAME2a% = %LMValue2a% 
echo         ----------------------------------------------------------
echo        Software level from Registry: %LLValue1d%
echo   **********************************************************************


echo.
echo   ..................................................
echo   **  License Managers:
echo   **    1 - Pool (in office) or Pro
echo   **    2 - Borrow (field, Arcview only)
REM echo   **    3 - For ANC-GIS Analyst Staff use only   REM ONLY for xxxx
echo   **
echo   **    9 - Exit with no change
echo   ..................................................
set /p choice= Enter a number (1-3, or 9 to exit):

REM  next line was best way I found to handle a null response
if '%choice%' == '' set choice=9
if %choice%==9 Goto :DoNothing

REM  Sets  variables for LM and restricted class for a LM (if needed) based on users selection
REM  !!!!  you need to change the set server lines to reflect your server. format    @servername
REM  !!!!     we needed   @server.domain
if %choice%==1 (
     set server="@LMservername1"
     set class="Viewer"
     echo.
     echo    *** Note: For in-office use                         ***
     echo    ***  License level reset to Basic/ArcView.          ***
     echo    ***  Use ChangeArcLevel.bat to switch between AV/AI ***
     echo.
)

if %choice%==2 (
     set server="@LMservername2"
     set class="Viewer"
     echo.
     echo    *** Note:For short term, fieldwork use  ***
     echo    ***  Set licence level to Basic.        ***
     echo    ***  Only ArcView available for this LM ***
     echo.
)
if %choice%==3 (
     set server="@LMservername3"
     set class="Professional"
     echo.
     echo    *** Note: For fulltime GIS staff only ***
     echo    ***  Set licence level to ArcInfo/Adv, since    ***
     echo    ***  that is only level available for this LM   ***
     echo.
)

REM sets the values in HKCU\Environment
SETX ARCGIS_LICENSE_FILE %server%
SETX ESRI_LICENSE_HOST   %server%
SETX ESRI_LICENSE_SERVER %server%
SETX ESRI_SOFTWARE_CLASS %class%     

TIMEOUT 2

REM "HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3" stores info that is stored in ArcGIS Admin
set KEY_NAME2="HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3"
set VALUE_NAME2a="LICENSE_SERVER"
set VALUE_NAME2b="SOFTWARE_CLASS"

REM  1)this FOR-IN-DO grab ARCGIS_LICENSE_FILE key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1a% 2^>nul`) DO (
    REM left in 1st FOR-IN-DO to show how to get name and type. Removed from other FOR-IN-DOs to conserver space
    REM set LMName1a=%%A 
    REM set LMType1a=%%B
    set LMValue1a=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_HOST key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1b% 2^>nul`) DO (
    set LMValue1b=%%C
)

REM  1)this FOR-IN-DO grab ESRI_LICENSE_SERVER key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1c% 2^>nul`) DO (
    set LMValue1c=%%C
)

REM  1)this FOR-IN-DO grab ESRI_SOFTWARE_CLASS key value from HKCU\Environment
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME1% /v %VALUE_NAME1d% 2^>nul`) DO (
    set LLValue1d=%%C
)

REM  1)this FOR-IN-DO grab LICENSE_SERVER key value from HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME2% /v %VALUE_NAME2a% 2^>nul`) DO (
    set LMValue2a=%%C
)

REM  1)this FOR-IN-DO grab LICENSE_SERVER key value from HKLM\SOFTWARE\Wow6432Node\ESRI\License10.3
FOR /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY %KEY_NAME2% /v %VALUE_NAME2b% 2^>nul`) DO (
    set LMValue2b=%%C
)

:DoNothing
echo.
echo. Exiting without making any changes
echo.

echo   ***********************************************************************
echo      Current ESRI License Manager: %LMValue1a%
REM echo      Current ESRI License Manager from Registry:
REM echo        From %KEY_NAME1%:
REM echo          %VALUE_NAME1a% = %LMValue1a% 
REM echo          %VALUE_NAME1b% = %LMValue1b% 
REM echo          %VALUE_NAME1c% = %LMValue1c% 
REM echo        From %KEY_NAME2%:
REM echo          %VALUE_NAME2a% = %LMValue2a% 
echo         ----------------------------------------------------------
echo        Software level from Registry: %LLValue1d%
echo   **********************************************************************
echo.
echo Hit any key to close program...
pause

 

 

Again, use at your own risk, but hope this might help others.  It should help our users (until network services decides to block this option).

3 people found this helpful

Attachments

    Outcomes