Click or drag to resize

RepositoryAddOrUpdateServerLicense Method

Adds/updates license information for Perforce Repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public string AddOrUpdateServerLicense(
	ServerLicense serverLicense,
	Options options
)

Parameters

serverLicense
Type: Perforce.P4ServerLicense
ServerLicense object along with required license specification properties.
options
Type: Perforce.P4Options
The '-i' flags needs to be used to add/update Server License information.

Return Value

Type: String
Message retrieved from server for add/update operation.
Remarks

p4 help license

license -- Update or display the license file

p4 license -o
p4 license -i
p4 license -u
p4 license -L

Info lists information about the current client (user name,
Update the Perforce license file.This command requires a valid
license file in the Perforce root directory.Typically this command
lets an administrator add extra licensed users to the Perforce server
without having to shut the server down and copy the license file to
the server root.

Most new license files obtained from Perforce can be installed with
this command, unless the server's IP address or port has changed.
In that case, stop the server, copy the new license file to the root,
and restart the server.

The -o flag writes the license file to the standard output.

The -i flag reads a license file from the standard input.

The -u flag reports the license limits and how many entities are in
use towards the limits.

The -L flag lists valid server IP and MAC addresses to be used when
requesting a valid license from Perforce Support.

This command requires 'super' access (or 'admin' for '-u'),
which is granted by 'p4 protect'.

**********************************************************************
When using the free version of the server(no license file) the server
is limited to 5 users and 20 workspaces, or unlimited users and
workspaces when the repository has less than 1,000 files
**********************************************************************
Examples
To add license: Pre-requisites: You have license file received from Perforce support. You are connected to the server repository.
// Read license file content into string and parse the same into serverlicense object.
LicenseCmdOptions option = new LicenseCmdOptions(LicenseCmdFlags.Input);
ServerLicense serverLicense = new ServerLicense();
serverLicense.Parse(serverLicenseSpecification);
string result = rep.AddOrUpdateServerLicense(serverLicense, options);
See Also