list_zone_users
Use the list_zone_users command to check Active Directory and return a list of zone users defined in the currently selected zone. If executed in a script, this command outputs its list to stdout so that the output appears in the shell where the script is executed. The command does not return a Tcl list back to the executing script. Use get_zone_users to return a Tcl list.
Zone Type
Classic and hierarchical
Syntax
list_zone_users [-upn]
Abbreviation
lszu
Options
This command takes the following option:
| Option | Description |
|---|---|
| -upn | Optional. Returns user names in user principal name (UPN) format rather than the default sAMAccount@domain format. |
Arguments
This command takes no arguments.
Return Value
This command returns a list to stdout of zone users for the currently selected zone. Each entry in the list contains the following user profile fields separated by colons (:) :
-
sAMAccountName@domainor the UPN of the zone user as it is stored in Active Directory.If the Active Directory user no longer exists for a zone user, the command returns the security identifier (SID) of the orphan user.
-
UNIX user name.
-
Numeric user identifier (UID).
-
Numeric identifier for the user’s primary group (GID).
If the GID has the number 2147483648 (which is 80000000 hex) it means that the UID is being used as the GID. (This can occur in hierarchical zones.)
-
Personal information from the GECOS field.
-
The user’s home directory.
-
The user’s default login shell.
-
Whether the user is enabled or disabled (in classic zones only).
Examples
list_zone_users
This example returns the list of users similar to this:
adam.avery@acme.com:adam:10001:10001:%{u:samaccountname}:%{home}/%{user}:%{shell}:
ben.brown@acme.com:brenda:10002:10002:%{u:samaccountname}:%{home}/%{user}:%{shell}:
chris.cain@acme.com:chris:10003:10003:%{u:samaccountname}:%{home}/%{user}:%{shell}:
Related Commands
Before you use this command, you must have a currently selected zone stored in memory. The following commands enable you to view and select zone users:
get_zone_usersreturns a Tcl list of the Active Directory names of zone users in the current zone.new_zone_usercreates a new zone user and stores it in memory.select_zone_userretrieves a zone user from Active Directory and stores it in memory.
After you have a zone user stored in memory, you can use the following commands to work with that zone user:
delete_zone_userdeletes the selected zone user from Active Directory and from memory.get_zone_user_fieldreads a field value from the currently selected zone user.save_zone_usersaves the selected zone user with its current settings to Active Directory.set_zone_user_fieldsets a field value in the currently selected zone user.