XenMobile: Script to revoke inactive devices

Script Xenmobile

Continuing my work on script creation based on Rest API, today I provide you with a script to revoke inactive Devices.

The purpose is to release licenses as when a Device is revoked the associated license is released.

If you don’t have a large pool of licenses it could be helpful.

Here after some screenshot.

On my Lab I have 3 Devices enrolled:

In fact I have 3 licenses used:

For the purpose of those tests, I have changed the Inactivity Timer in the Server Properties to 1 day.

After 1 day without connection for 2 of my devices, the console shows:

Run the script:

  • Provide the server name

  • Provide credentials (account must be local with ADMIN rights)

  • The current parameter is retrieved and shown

  • The total number of inactive device is shown and a confirmation is asked

  • Each inactive Device is revoke individually.

After doing that, when I go back in the console under Settings / Licensing, I have:

The script can be downloaded here

If you test it, please leave a comment 😉

Thanks

Arnaud