# Programmatic license activation and unactivation

**URL:** <https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 21, 2024, 4:54pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948 "2024-11-21T16:54:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [November 21, 2024, 4:54pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/1 "2024-11-21T16:54:37Z")

</div>

Is there any way to programmatically activate and deactivate ignition licenses on given machines? I'm working on some automated VM orchestration tooling and would want to pass a license around between active ephemeral VMs before deleting inactive ones (With only one VM running at a time).

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [November 21, 2024, 4:58pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/2 "2024-11-21T16:58:14Z")

</div>

(I assume this is something easier in 8.3)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 21, 2024, 4:59pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/3 "2024-11-21T16:59:11Z")

</div>

There's a little bit of support for this in the gwcmd utility: [Gateway Command-line Utility - gwcmd | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/gateway/gateway-command-line-utility-gwcmd#command-line-utility-options)

See `--unactivate` and `--uselicense`.

It requires some interaction with the licensing servers as well; it's not assuming that you're working with an online gateway that will then make the calls to the server itself.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 21, 2024, 4:59pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/4 "2024-11-21T16:59:23Z")

</div>

> [@Leor\_Fishman](#):
>
> (I assume this is something easier in 8.3)

Probably

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [November 21, 2024, 5:01pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/5 "2024-11-21T17:01:28Z")

</div>

So the path would be --unactivate followed by a CURL to the license server or similar, and to reactivate --activate, then CURL, then --use-license with the output ipl?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 21, 2024, 5:04pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/6 "2024-11-21T17:04:10Z")

</div>

Yeah something like that.

The 8-digit leased license keys might be better suited to your use case...

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [November 21, 2024, 5:05pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/7 "2024-11-21T17:05:07Z")

</div>

The problem is: "However, due to the frequent checks, they require extra attention and depend on the Gateway having internet access at all times." This isn't something I can assume for my deployments

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 21, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/8 "2024-11-21T17:08:07Z")

</div>

I'm not really sure if this method with the gwcmd is meant for automation, it looks to me like it's meant to be done by hand.

The page where activation/unactivation requests happen is here: [Support - Inductive Automation](https://inductiveautomation.com/support/activation)

I don't know anything about the service that backs this page or how you would access it programatically.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 21, 2024, 5:08pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/9 "2024-11-21T17:08:56Z")

</div>

@kcollins might know more

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [November 21, 2024, 6:08pm UTC](https://forum.inductiveautomation.com/t/programmatic-license-activation-and-unactivation/98948/10 "2024-11-21T18:08:06Z")

</div>

Your use case sounds ideal for the 8-digit leased activation system (although it seems like connectivity may be a limiting factor for you). You could configure each VM with the same leased licensing configuration (which lives at `data/leased-activation/config.json` under the Ignition 8.1.x installation folder) and then enable [Leased Activation Session Termination](https://docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/gateway-configuration-file-reference#leased-activation-session-termination). This will cause the license session to be released on a clean shutdown of Ignition. The default behavior is to persist the session on disk (under a `data/leased-activation/.cached-response-XXXX-YYYY` file) so that it can be immediately resumed on a restart. The consequence of this is that your session is orphaned [to that one gateway] until its validity duration has expired.

You can place a properly structured `config.json` into place on the filesystem and Ignition will pick that up on startup. It doesn't currently react to changes of this file once running.
