Skip to content

Azure AD Azure AD: Licences

Summary

This module contains actions for auditing, assigning, & revoking Licences in Azure AD.

Actions

azure_ad.licences.

assign_to_user

Assign a licence to a user.

Minimum Plugin Version: 1.0.0

Input
  • client: an AzureClient

  • user_principal_name: the User's principal name

  • sku_id: the licence SKU ID

  • disabled_plans: optional list of ServicePlans to disable while assigning the licence

Enabling & Disabling Plans

You can also use this action to update a user's plans for a given licence.

To disable plans for a licence the user already has:

  • assign them the licence
  • use the disabled_plans input to turn off the relevant plans

To enable plans for a licence the user already has:

  • assign them the licence
  • make sure the plans you want to enable are not supplied in disabled_plans

Users can select plans using actions in the service_plans module.

Each Licence contains its associated ServicePlans.

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- azure_ad.licences.assign_to_user:
    user_principal_name: john.smith@domain.com
  load:
    sku_id: licence.sku_id
    client: azure_client

azure_ad.licences.

display

Display licences in a table.

The table will have the following columns:

  • Part Number
  • SKU ID
  • Paid Units
  • Consumed Units
  • Remaining Units

Minimum Plugin Version: 1.2.0

Input
  • text: the title of the table

  • licences: any number of Licences

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- azure_ad.licences.get_all:
  load:
    client: azure_client
  save: licences

- azure_ad.licences.display:
    text: All Licences
  load:
    licences: licences

azure_ad.licences.

display_for_users

Generate & display a table of Licences & the Users assigned to each.

Minimum Plugin Version: 1.0.0

Input
Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- azure_ad.users.get_all:
  load:
    client: azure_client
  save: users

- azure_ad.licences.display_for_users:
  load:
    users: users
    client: azure_client

azure_ad.licences.

display_tabbed

Display licences in a table with multiple tabs.

The table will have the following columns:

  • Part Number
  • SKU ID
  • Paid Units
  • Consumed Units
  • Remaining Units

Minimum Plugin Version: 1.2.0

Input
  • text: the title of the table

  • tabs: a dictionary where each key is a tab name & each value is any number of Users

Output

Nothing is outputted by this action.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
- azure_ad.licences.get_for_user:
    user_principal_name: user.1@domain.com
  load:
    client: azure_client
  save: user_one

- azure_ad.licences.get_for_user:
    user_principal_name: user.2@domain.com
  load:
    client: azure_client
  save: user_two

- ppa_tools.dictionaries.create:
  load:
    User One: user_one
    User Two: user_two
  save: table_tabs

- azure_ad.licences.display_tabbed:
    text: Licences Per-User
  load:
    tabs: table_tabs

azure_ad.licences.

get_all

Get all company licences.

Minimum Plugin Version: 1.0.0

Input
Output

A list of Licences.

Example
1
2
3
4
- azure_ad.licences.get_all:
  load:
    client: azure_client
  save: licences

azure_ad.licences.

get_by_part_number

Get the company licence with the supplied part number.

Minimum Plugin Version: 1.0.0

Input
  • client: an AzureClient

  • part_number: the licence part number

Part Numbers

Licence part numbers can be found here in the String ID column.

Output

A single Licence.

Example
1
2
3
4
5
- azure_ad.licences.get_by_part_number:
    part_number: O365_BUSINESS_PREMIUM
  load:
    client: azure_client
  save: licence

azure_ad.licences.

get_for_user

Get all licences assigned to a user.

Minimum Plugin Version: 1.0.0

Input
Output

A list of Licences.

Example
1
2
3
4
5
- azure_ad.licences.get_for_user:
    user_principal_name: example.user@domain.net
  load:
    client: azure_client
  save: licences

azure_ad.licences.

high_remaining_units

Get all licences with a remaining unit count greather than or equal to the supplied threshold.

Minimum Plugin Version: 1.2.0

Input
  • client: an AzureClient

  • threshold: remaining unit count treated as 'high' (defaults to 15)

Output

A list of Licences.

Example
1
2
3
4
- azure_ad.licences.high_remaining_units:
  load:
    client: azure_client
  save: high_remaining_units

azure_ad.licences.

low_remaining_units

Get all licences with a remaining unit count less than or equal to the supplied threshold.

Minimum Plugin Version: 1.2.0

Input
  • client: an AzureClient

  • threshold: remaining unit count treated as 'low' (defaults to 5)

Output

A list of Licences.

Example
1
2
3
4
- azure_ad.licences.low_remaining_units:
  load:
    client: azure_client
  save: low_remaining_units

azure_ad.licences.

remove_from_user

Remove a licence from a user.

This action will not fail if the user is not assigned the supplied licence.

Minimum Plugin Version: 1.0.0

Input
  • client: an AzureClient

  • user_principal_name: the User's principal name

  • sku_id: the licence SKU ID

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- azure_ad.licences.remove_from_user:
    user_principal_name: john.smith@domain.com
  load:
    sku_id: licence.sku_id
    client: azure_client

azure_ad.licences.

select

Display licences in a table & prompt the task operator to make a selection.

The table will have the following columns:

  • Part Number
  • SKU ID
  • Paid Units
  • Consumed Units
  • Remaining Units

Minimum Plugin Version: 1.2.0

Input
  • text: the title of the table

  • licences: any number of Licences

  • minimum: the minimum number of selections

  • maximum: the maximum number of selections

Output

A Selection containing:

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- azure_ad.licences.get_all:
  load:
    client: azure_client
  save: licences

- azure_ad.licences.select:
    text: Select Licences
  load:
    licences: licences
  save: selection

azure_ad.licences.

select_one

Display licences in a table & prompt the task operator to select one.

The table will have the following columns:

  • Part Number
  • SKU ID
  • Paid Units
  • Consumed Units
  • Remaining Units

Minimum Plugin Version: 1.2.0

Input
  • text: the title of the table

  • licences: any number of Licences

Output

A single Licence.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- azure_ad.licences.get_all:
  load:
    client: azure_client
  save: licences

- azure_ad.licences.select_one:
    text: Select a Licence
  load:
    licences: licences
  save: licence