Skip to main content

Import of licenses

Function description

The ImportLic application is used to import licenses from a CSV file, including assignment to individual computers or users. It can also be run in a mode to synchronize assigned licenses with an external system. This function is available for on-premise customers only.

Command line syntax

ImportLic.exe /input*"path and name of CSV file"* { /conn*"connection string"| /server"database server name"/db"database name"*} [ /import] [ /mode {ImportLicenses | UpdateItems}] [ /force] [ /headers] [ /help]

Parameters

ParameterDescription
/input

The path and name of the CSV file from which the import is to be performed.

/conn /server /db

These parameters are used to set the connection to the Alvao database. A connection string can be used (e.g. /conn "Data source=.\sqlexpress;Initial Catalog=test;Integrated Security = True;TrustServerCertificate=True"), or simply specify a specific SQL server and DB (e.g. /server ".\sqlexpress" /db "test").

In case you use the /server parameters and /db, the database connection is made using Windows Integrated Authentication. If you specify all of these parameters,only /conn parameter will be used, /server and /db will be ignored.

/importImport Data. If you do not use this switch, only the syntax check of the data in the CSV file is performed.
/mode

Import mode:

  • ImportLicenses - import new licenses. This is the default mode.
  • UpdateItems - import license items in a per-user licensing model, i.e. assigning or removing licenses to specific users.

Detailed description of the modes can be found below.

/forceForces import of data even if there are errors in the data.
/headersUse if the first line of the file contains column names.

ImportLicenses

Import new licenses, including documents, and assign the created licenses to computers or users.

Description of all supported columns

warning

The order of the columns is fixed, it does not depend on the column name. Therefore, the imported file must contain all columns, only the values in some of them can be empty. This is also true if the force parameter is used.

warning

Dates must be entered in the correct format, e.g. "1.12.2014" or "2015-12-01".

License

Name of column in CSVOptionsCheckMandatory
ProductExact product name from the ALVAO Software Product Library.YesYes
License nameName of an existing license in the database, or an empty value (the license name will then be the same as the product name).NoNo
NumberNumber of licenses purchased - INT number, must be entered.YesYes
License TypeOne of the following values must be entered: per device, per user, per connection, per processor or per core.YesYes
Activity fromDate from which the license is valid - the date must be entered in the correct format.YesYes
Valid untilDate until which the license is valid - can be a blank value or the correct date format.YesNo
Support toDate until which the license is supported - can be a blank value or the correct date format.YesNo
License type

License Type - must be one of the following values.

Float, Multi or OEM.

YesYes
License Activation KeyLicense Activation Key - enter any text or an empty value.NoNo
License Inventory NumberLicense Inventory Number - enter any text or a blank value.NoNo
Certificate Number

Any text or empty value - if specified, the program searches for the certificate by this number in the DB.

If it finds it, it assigns the created license to the found certificate from the DB, otherwise it creates a document of type "Certificate" and assigns it to the currently created license.

NoNo
License Cost CenterLicense cost center - enter any text or a blank value.NoNo
Organization

The name of the organization that owns the license. If you specify a blank value, the license can be assigned to computers or users from any organization.

YesNo
NoteLicense Note - enter any text or a blank value.NoNo

License items

This section does not need to be filled in for a license - in this case the license will be created without license items.

CSL column nameOptionsCheckMandatory
ComputerNetwork name of a specific computer in the DB - the computer must exist in the database.YesNo
Item Activation KeyLicense Item Activation Key - enter any text or a blank value.NoNo
Item cost centreLicense Item Cost Center - enter any text or a blank value.NoNo
Inventory item numberLicense Item Inventory Number - enter any text or a blank value.NoNo
Item TicketLicense Item Ticket - enter any text or a blank value.NoNo
Item NoteLicense Item Note - enter any text or a blank value.NoNo

Document

Again, this section does not need to be filled in. In this case, no document is created for the newly created license. Documents are stored in the document-folder with the smallest ID that is linked to the software license (usually the All Documents folder).

Name of column in CSVOptionsCheckMandatory
Invoice numberEnter any text or a blank value.NoNo
Invoice number 2Enter any text or blank value.NoNo
Date of issueInvoice issue date - the date must be entered in the correct format.YesNo
Path to attachmentPath to document attachment (searched in shared documents), or empty value.NoNo
SupplierThe name of the supplier in DB is searched, if found, the found record is assigned, otherwise a new supplier with this name is created. It can also be an empty value.NoNo
Document noteEnter any text or blank value.NoNo

Scenarios

Sample CSV file

Product;License Name;Number;License kind;Valid From;Valid until;SupportUntil;License Type;Asset. license key;License inv. no.;Cert. number;Cost. center;Organization;License note;Computer;Item activ. key.;Item cost center;Item inv. no.;Item rquest;Item note;Invoice no.;Invoice no. 2;Issue date;Attachement path;Supplier;Invoice note
Microsoft Windows 2000 Professional;Win2k;1;per device;30.01.2007;15.12.2030;15.05.2008;float;AK-1234;IC-ALL-1234;Cert1;Strd1;Organizace;Poznamka k licenci1;PC1;AK-PC-1;StredPc1;IC-PC-1;REQ-ITM-1;Pozn PC1;CF-1234;CF-2-1234;15.08.2006;Faktury\f01.doc;DOD1;Pozn. doc. 1
Microsoft Windows XP Professional;WinXP;1;per device;15.01.2007;15.08.2030;15.05.2008;normal;AK-1234;IC-ALL-1234;Cert1;Strd1;;Poznámka k licenci1;PC1;AK-PC-1;StredPc1;IC-PC-1;REQ-ITM-2;Pozn PC1;CF-1234;CF-2-1234;15.08.2006;Faktury\f01.doc;DOD1;Pozn. doc. 1
Microsoft Windows 2000 Professional;Win2k;1;per device;15.01.2007;15.08.2030;15.05.2008;normal;AK-1234;IC-ALL-1234;Cert1;Strd1;;Poznámka k licenci1;PC2;AK-PC-2;StredPc2;IC-PC-2;REQ-ITM-3;Pozn PC2;CF-1234;CF-2-1234;15.08.2006;Faktury\f01.doc;DOD2;Pozn. doc. 2
Microsoft Windows XP Professional;;2;per device;15.01.2008;;15.01.2010;multi;AK-888;IC-ALL-8888;Cert2;Strd1;;Poznámka k licenci2;PC1;AK-PC-1;StredPc1;IC-PC3;REQ-ITM-4;Pozn PC1;CF-8888;CF-2-1237;15.08.2008;Faktury\f02.doc;DOD1;Pozn. doc. 2
Microsoft Windows XP Professional;;2;per device;15.01.2008;;15.01.2010;multi;AK-888;IC-ALL-8888;Cert2;Strd1;;Poznámka k licenci2;PC2;AK-PC-2;StredPc2;IC-PC2;REQ-ITM-4;Pozn PC2;CF-8888;CF-2-1237;15.08.2008;Faktury\f02.doc;DOD1;Pozn. doc. 2

CSV contains a header with column names. The data in the file will be checked before importing. If the data is incorrect, the import will not be performed. Import command line:

ImportLic.exe /input "c:\data\license.csv" /server server\sql2008 /db alvao /import /headers

Import multiple license items to one license

You do this by copying the row with the data in the "License" section, changing only the "License Items" section. Example CSV import of one license with 3 items:

Product;License Name;Number;License kind;Valid From;Valid until;SupportUntil;License Type;Asset. license key;License inv. no.;Cert. number;Cost. center;Organization;License note;Computer;Item activ. key.;Item cost center;Item inv. no.;Item request;Item note
Microsoft Windows XP Professional;;3;per device;15.01.2008;;15.01.2010;multi;AK-888;IC-ALL-8888;Cert2;Strd1;;Poznámka k licenci2;PC1;AK-PC-1;StredPc1;IC-1;REQ-ITM-4;Pozn. 1
Microsoft Windows XP Professional;;3;per device;15.01.2008;;15.01.2010;multi;AK-888;IC-ALL-8888;Cert2;Strd1;;Poznámka k licenci2;PC2;AK-PC-2;StredPc2;IC-2;REQ-ITM-4;Pozn. 2
Microsoft Windows XP Professional;;3;per device;15.01.2008;;15.01.2010;multi;AK-888;IC-ALL-8888;Cert2;Strd1;;Poznámka k licenci2;PC3;;StredPc2;IC-3;REQ-ITM-4;Pozn. 3
note

The CSV contains 2 license entries that will be assigned to PC1 and PC2 and the last entry will not be assigned to any computer.

We don't have complete data

For the time being, we want to upload incomplete data, which will be corrected as soon as there is supporting information. We are only uploading values to a few columns that we have defined in the header. The file will not be checked and we will force the import of even incomplete and incorrect data. Import command line:

ImportLic.exe /input "c:\data\license.csv" /server server\sql2008 /db alvao /force /headers

UpdateItems mode

Synchronize assigned licenses to users with an external system (e.g. M365).

The input CSV contains a list of licenses and the users to be assigned those licenses.

Setting and checking input data

In the external system, set the export to a CSV file to exactly match the description of the columns below.

Before starting the import into Alvao, make sure that:

  1. All the licenses you want to synchronize,
    1. have been set to License ID on the external system, which is used to match the license to the external resource (records for non-existent Ids are skipped),
    2. have a per-user licensing model set, and
    3. have automatic allocation disabled.
  2. The User object template contains the Email property. This property matches users in CSV with users in Alvao.
  3. All users listed in the CSV exist in AM as objects in the tree, and their email address is unique within the active record.
    1. Non-existing users are automatically created in the Read Objects folder.
    2. When multiple users with the same email are found, the license is assigned to the one with the lower Id.
  4. The input CSV contains all users to whom the license is assigned. Others will have their license automatically revoked.

Description of all supported columns

warning

The order of the columns is fixed, it does not depend on the column name. Therefore, the imported file must contain all columns, only the values in some of them can be empty. This is also true if the force parameter is used.

Name of column in CSVOptionsCheckMandatory
UId

License ID in the external system. See AM Console - License registry - Edit license.

NoYes
LicCountTotal number of licenses purchased.YesNo
UserEmailUser emailYesYes
UserNameUserNameNoNo

Sample CSV file

UId;LicCount;UserEmail;UserName
Alvao:POWER_BI_PRO;10;james.smith@contoso.com;James Smith
Alvao:POWER_BI_PRO;10;david.cooper@contoso.com;David Cooper
Alvao:FLOW_FREE;;john.david.cooper@contoso.com;David Cooper

Download the code here.

CSV contains a header with column names. The data in the file will be checked before the import. If the data is incorrect, the import will not be performed. Import command line:

ImportLic.exe /input "c:\data\licenseItems.csv" /server server\sql /db alvao /import /mode UpdateItems /headers