create_user

Use the create_user command to create a new zone user for the currently selected zone. This command creates the new user based on an existing Active Directory user. It also assigns the new user a new UNIX profile that includes the user name, user ID, primary group ID, GECOS data, home directory, shell type, and role (or in classic zones whether the user is enabled or disabled).

You can assign the new user a role in a non-classic zone or you can enable or disable the new user in a classic zone. In a non-classic zone, create_user uses whatever role you specify to create a new role assignment object that links the new zone user to the specified role.

Syntax

create_user UPN uname uid gid gecos home shell role

Options

This command takes no options.

Arguments

This command takes the following arguments:

Argument Type Description

UPN

string

Required. Specifies the user principal name of the Active Directory user to use as the basis for the new zone user.

uname

string

Required. Specifies the user name of the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the user name.

uid

string

Required. Specifies the user ID for the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the user ID.

gid

string

Required. Specifies the group ID for the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the group ID.

gecos

string

Required. Specifies the GECOS value (new user account information) for the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the GECOS value.

You can’t set the GECOS value if the currently selected zone is a classic zone.

home

string

Required. Specifies the home directory for the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the home directory.

shell

string

Required. Specifies the shell type for the new zone user.

For hierarchical zones, you can specify a dash (-) for this argument if you don’t want to set the shell type.

role

string or Boolean value

Required.

For classic zones, this argument determines whether to enable or disable the new zone user. A value of 1, Y, or y enables the user. Any other value disables the user.

For hierarchical zones, this argument identifies the role to assign to the new zone user. You can specify a dash (-) for this argument if you don’t want to set the role. However, a role must be assigned before the new zone user has access to computers in hierarchical zones.

Return value

This command returns nothing if it runs successfully.

Examples

create_user ulysses.urkham@acme.com ulysses 1005 - - %{home}/%{user} %{shell} -

This example creates a zone user “ulysses” based on the Active Directory user ulysses.urkham@acme.com. It sets a UID, does not set a GID or GECOS value by using dashes, sets home and shell values, and does not set a role value (specified by using a dash).

Related Tcl library commands

  • create_aduser creates a new Active Directory user account and sets its password.
  • create_adgroup creates a new Active Directory group account and specifies its scope.
  • create_group creates a new zone group based on an existing Active Directory group, assigns it a UNIX name and group ID, and saves the new group to Active Directory.
  • add_user_to_group adds an Active Directory user to an Active Directory group.
  • remove_user_from_group removes an Active Directory user from an Active Directory group.