Licensing commands

While the Citrix Licensing Manager provides an easy method of accessing many licensing features, you can also perform licensing tasks using commands. You might use the license administration commands for advanced operations on the License Server that are not available in the console. Such operations include diagnosing check-out problems using lmdiag.

License administration commands are stored in:

  • C:\Program Files\Citrix\Licensing\LS on a 32-bit computer
  • C:\Program Files (x86)\Citrix\Licensing\LS on a 64-bit computer

Description of the licensing commands

Note:

In License Server version 11.16.6 build 34000, existing user management lmadmin.exe is replaced with Citrix owned user management lmgrd.exe. Ensure you do not use lmadmin.

Licensing commands Description
lmgrd Starts and manages the licensing server and other associated processes. lmgrd is the core licensing server file used for the Citrix licensing Windows service. It hosts the license server port (default 27000). Use the Citrix Licensing Manager for licensing configuration and administration tasks.
lmdiag Diagnoses license check-out problems.
lmdown Gracefully shuts down the License Manager and Citrix vendor daemons (disabled by default).
lmhostid Reports the host ID of the server on which Citrix Licensing is running.
lmreread Causes the License Manager daemon to reread the license file and start the Citrix vendor daemon.
lmstat Displays the status of a License Server.
lmutil Displays a list of licensed utilities or runs other commands.
lmver Displays version information for the licensing binaries.
udadmin Displays all licensed users and devices and deletes specified licensed users and devices. This command applies to user/device licenses only. To get a list of licenses, specify udadmin -list.
CtxManageUserAndGroup Configures user and group access to manage the License Server.
CtxManageUserAndGroup.exe –useradd “domain\username” -Role “admin/user” Command to add a user.
CtxManageUserAndGroup.exe –useradd “domain\username” –Role “adminGroup/userGroup” Command to add a group.

Format license commands

Formatting conventions for the license administration commands:

Convention Description
Bold A command or switch, such as lmstat.
Italic Replace variables with a value. For example, in the expression: lmstat -c license_file_list. Before you run the command, replace license_file_list with the names of one or more license files.
[Brackets] Brackets around the text indicate the options that you can add to the command. It might indicate that the text within the brackets must be replaced. For example: lmstat [-a] [-c license_file_list] [-f [feature]] can be written as: C:\Program Files (x86)\Citrix\Licensing\LS>lmstat.exe -a -c @localhost -f XDT_ENT_UD

Universal arguments

Valid arguments for most license administration commands:

Argument Description
-all Displays all information about the License Server.
-c Lets you specify a license files or License Server port and host name. If you specify the path without a license file name, the command applies to all the license files in the directory. For a local host: -c @localhost. For a remote License Server: -c @servername. For a License Server in a cluster: -c @clientaccesspointname. For a specified path: -c path. For the names of one or more license files: -c license_file_list. You can enter more than one license file path by separating each path with a semicolon. Path names that include spaces must be enclosed in double quotes.
-h License handle, as reported by lmstat -a. The license handle is a number used to identify a specific checked out license.
-help Displays usage information and exits.
-s [server] If you don’t specify a server, this argument displays the status of all the license files listed on the License Server or the license files on all the License Servers.
-verbose Displays a longer description for all errors found.

Diagnose checkout problems (lmdiag)

The lmdiag command allows you to diagnose problems when a product cannot check out a license. In particular, you can test if your licenses are valid and if the License Server is running. When you run this command, it attempts to check out a license.

You can also use the lmdiag command to see if a specific type of license is working.

Example:

Run lmdiag on your Citrix Virtual Apps server Advanced edition licenses only. Specify MPS_ADV_CCU as an argument.

Syntax:

lmdiag -c license_file_list [-n] [feature[:keyword=value]]

Argument Description
-c license_file_list Diagnoses the specified files. You can also use:-c @localhost or -c @server-name
-n Runs in non-interactive mode. lmdiag does not prompt for any input in this mode.
feature Limits the feedback to the specified feature.
keyword=value If a license file contains multiple lines for a particular feature, the result is limited to the line containing the text value. For example: lmdiag -c @localhost MPS_ENT_CCU:HOSTID=LICSERV01 attempts a checkout on the line with the host ID LICSERV01. The keyword is one of the following: VERSION, HOSTID, EXPDATE, KEY, VENDOR_STRING, ISSUER

If no feature is specified, lmdiag operates on all features in the license files in your list. The lmdiag command displays information about the license, then attempts to check out each license. When the checkout succeeds, lmdiag indicates that the checkout was successful. When the checkout fails, lmdiag gives you the reason for the failure. The lmdiag command tries to connect to each TCP/IP port on the License Server. It detects if the port number in the license file is incorrect. lmdiag lists each TCP/IP port number that is listening, and if -c license_file_list is specified, diagnoses the specified files.

The lmdiag command does not contact the computer running the Citrix product when it attempts to check out licenses. The lmdiag command indicates only if there are problems on the License Server. That is, your product cannot check out licenses because it is pointing to the wrong License Server, but lmdiag does not detect this problem. For example, a License Server that does not have licenses for that product on it. The lmdiag command reports that it can check out licenses when the Citrix product is pointing to the wrong License Server.

Stop daemons (lmdown)

The lmdown command shuts down the License Manager daemon and the Citrix vendor daemon on your License Server or all License Servers on your network. The lmdown command is disabled by default.

Syntax:

lmdown -c license_file_list [-vendor CITRIX] [-q] [-all]

Argument Description
-c license_file_list or -c @localhost or -c @server Use the specified license files. We always recommend specifying -c license_file_list with lmdown. You can also use:-c @localhostor -c @server-name
-vendor CITRIX Shut down only the Citrix vendor daemon. The License Manager daemon continues to run.
-q Do not prompt or print a header. Otherwise, lmdown asks “Are you sure? [y/n]: .”
-all If multiple servers are specified, automatically shuts down all of them. -q is implied with -all.

Run the lmdown command on a License Server. You can use -all to shut down all the License Servers on your network.

If lmdown encounters more than one server and you didn’t specify the -all argument, the command displays a choice of License Servers to shut down. For example, the -c argument specifies a directory with many *.lic files. Shut down the remote License Servers by using -c and specifying the name of the License Server.

Note:

If you use the Task Manager to terminate the License Manager daemon (Citrix Licensing Service), stop the lmgrd process first, then stop the Citrix vendor daemon process.

To stop and restart the Citrix vendor daemon only, use lmdown -c @localhost -vendor CITRIX, then use lmreread -c @localhost -vendor CITRIX to restart the vendor daemon.

Checks the license server binding information (lmhostid)

The lmhostid command returns the host ID of the License Server. You can use the command to check the host name of your License Server. You can open a license file and compare the host name in the license file to that of your License Server.

Note

Citrix Licensing, versions 11.5 and later for Windows allows you to display multiple host IDs if there are more than one host.

Syntax:

lmhostid -bindingidentifier

The bindingidentifier is an argument in the command.

Argument Description
-ether Used for product licenses that are tied to the MAC address of the appliance.
-internet Used for Windows-based Citrix product software licenses that require a TCP/IP address.
-hostname Used for Windows-based Citrix product software licenses that are tied to the host name of the License Server. Note: The parameter hostname is case-sensitive and must match your License Server name exactly.

Reread license and options files (lmreread)

The lmreread command causes the Citrix vendor daemon to reread changes to the license file and the options file. After rereading, the Citrix vendor daemon uses the new settings and licenses from then on.

You cannot use lmreread remotely; run it locally on the License Server.

Syntax:

lmreread -c license_file_list [-all] [-vendor CITRIX]

Argument Description
-c @localhost or -c license_file_list Use the specified license files.
-all If more than one lmgrd is specified, this argument instructs all License Manager daemons to reread.
-vendor CITRIX Specifies for the Citrix vendor daemon to be restarted.

Examples:

  • lmreread -c @localhost \[-all\]
  • lmreread -c @client\_access\_point\_name
  • lmreread -c /opt/citrix/licensing/myfiles/CITRIX.lic -vendor CITRIX

Display the list of licensing utilities (lmutil)

The lmutil command displays a list of licensing utilities when used standalone. When you specify lmutilwith another command, it runs that command.

Syntax:

lmutil

lmutil other_command

Examples:

  • lmutil

    Displays all the licensing utilities.

  • lmutil lmstat -c @localhost

    Runs the lmstat command.

Determine licensing status (lmstat)

The lmstat command helps you monitor the status of all licensing activities and provides you with information about license check outs, including:

  • The product that checked out one or more licenses
  • The checkout data
  • The version of the license file
  • The License Server name and port
  • The date the license was checked out
  • Information about the Citrix vendor daemon status and the license files

The lmstat command displays the information that it receives from the License Server. The lmstat command displays only one use of the license, even if there are multiple connections sharing that license.

Syntax:

lmstat [-a] [-c license_file_list] [-f [feature]] [-i [feature] [-s[server] [-S [CITRIX]] [-t timeout_value]

Argument Description
-a Displays all information.
-c @localhost or -c @server or -c license_file_list Uses the specified license files.
-f [feature] Displays the products using a feature (product license). If you don’t specify a feature, usage information for all features is displayed.
-i [feature] If you don’t specify a feature, this argument displays information from the INCREMENT line for the specified feature (product license) or all features.
-s [server] If you don’t specify a server, this argument displays the status of all license files listed on the License Server or the license files listed on all the License Servers.
-S [CITRIX] Lists all product servers using the features (product licenses) served by the Citrix vendor daemon.
-t timeout_value Sets connection time-out to timeout_value. This value limits the amount of time lmstat spends attempting to connect to the License Server.

The output from lmstat -c @localhost -a looks similar to this example. The lines in the example might break because of the screen space.

License Server status: 27000@localhost

   License file(s) on localhost: C:\Program Files (x86)\Citrix\Licensing\MyFiles\citrix_startup.lic:C:\Program Files (x86)\Citrix\Licensing\MyFiles\License.lic:

   localhost: license server UP v11.15.0

   Vendor daemon status (on LicenseServer):

      CITRIX: UP v11.15.0

Feature usage info:

   Users of CITRIX: (Total of 10000 licenses issued; Total of 1 licenses in use)

   "CITRIX" v2038.0101, vendor: CITRIX, expiry: permanent(no expiration date)
vendor_string: ;LT=SYS;GP=720;SA=0
floating license

   XDT DDCPrinc-0001.citrix.com XDT XDT\_PLT\&MPS_PLT_2018.0518 (v1.0) (localhost/27000 102), start Tue 5/8 17:59

Users of CTXLSDIAG: (Total of 10000 licenses issued; Total of 0 licenses in use)

Users of XDT_PLT_CCS: (Total of 200000 licenses issued; Total of 3 licenses in use)

   "XDT_PLT_CCS" v2018.1201, vendor: CITRIX, expiry: 01-dec-2018
vendor_string: ;LT=Retail;GP=720;PSL=10;CL=VDS,VDA,VDE,VDP;SA=0;ODP=0;NUDURMIN=2880;NUDURMAX=525600
floating license

   XDT DDCAux-0001.citrix.com XDT 00001E3A (v2018.0518) (localhost/27000 534201), start Wed 5/9 15:17
   XDT DDCAux-0001.citrix.com XDT 00001E81 (v2018.0518) (localhost/27000 392504), start Wed 5/9 15:18
   XDT DDCAux-0001.citrix.com XDT 00001E0C (v2018.0518) (localhost/27000 419703), start Wed 5/9 15:18
<!--NeedCopy-->

The following represents a breakdown of the information contained in the MPS_ENT_CCU line of the lmstat output:

    Description
Citrix product name MPS The name of the Citrix product that has the license checked out.
Host name mps_server1 Computer where the Citrix product is running.
Display MPS Name of the Citrix product that has the license checked out.
Server host license_server1 Computer where the License Server is running.
Port 27000 TCP/IP port where the License Server is running.
Handle 203 License handle. The license handle is a number used to identify a specific checked out license.
Checkout time start Wed 3/17 11:56 Time that this license was first checked out.

The command lmstat -c @localhost -a can potentially generate much network activity in systems that have many products licenses checked out.

You can use lmstat -a to verify license checkout data.

Display versions of binaries (lmver)

The lmver command displays version information for the licensing binaries, such as the command utilities.

Syntax:

lmver binary

Example:

lmver lmdiag

Display or release licenses for users or devices (udadmin)

The udadmin displays the licensed users and devices and releases licenses for specified users and devices.

Note:

UDAdmin tool is only used for reporting license usage for user/device license model and not concurrent licenses.

You can release a license for a user only when:

  • The employee is no longer associated with the company.
  • The employee is on an extended leave of absence.

You can release licenses for devices only when the devices are out of service.

Caution:

Mass release of licenses, before the automatic 90-day lease period, outside of the reasons highlighted earlier might violate the Citrix EULA. Before doing so, contact Citrix.

The udadmin command-line help displays usage information only in English, but you can use the command on non-English systems.

Syntax:

udadmin [-options] [-delete | -events | -list | -times]

Options Description
-f feature name When used with -list or -delete, displays or releases the license for only the user or device for the specified feature name.
-user user name Releases the license for only the user specified by the user name.
-device device name Releases the license for only the device specified by the device name.
-a Lists all features and versions installed on the License Server.
Argument Description
-delete Releases the license for one user, feature, or device at a time.
-events Reports all events logged by the user/device licensing for each feature sorted in chronological order.
-list Displays the users and devices with licenses and the time since the last update. If significant activity occurred within 15 minutes of the last report, the time to the next update appears. Specifying -list -times generates output containing a timestamp.
-times Specifying -list -times generates output containing a timestamp.
No argument or ? Displays usage information for the udadmin command.

Examples:

-  udadmin -list -times

    Usage data is 0 minutes old. Next update in 15 minutes.

    Users:

    u01.01 XDT_ENT_UD 2017.1201 (Thu Sep 14 13:41:07 2017)

    u01.04 XDT_ENT_UD 2017.1201 (Thu Sep 14 13:41:07 2017)
    .
    .
    .

    Devices:

    D.ADV.23 XDT_ADV_UD 2017.1201 (Thu Sep 21 18:31:01 2017)

    D01 XDT_PLT_UD 2017.1201 (Tue Sep 12 14:30:33 2017)

-  udadmin -list -a

    Lists all features, versions, counts of licenses, and the users and devices for each feature.

-  udadmin -f XDT_ENT_UD -device dn01.88 -delete

    Releases one device from one feature.

<!--NeedCopy-->