Sun Java System Portal Server 7.1 Command Line Reference

Chapter 1 psadmin Utility

This chapter describes the usage of psadmin command-line utility. All CLIs (Command-line Interface) are called from a single utility - psadmin. CLIs serve as one subcommand of psadmin.

This chapter describes the following topics.

psadmin Options

Following options are provided with psadmin:

[--help | -?]

Prints a brief help page to the standard output. If no subcommand is present, a list of subcommands that are supported by psadmin is printed

[--help component=component name]

Lists all subcommands that are supported by this component. Component name can be one of the following values: portal, desktop, logging, monitoring, portlet, rewriter, search, sra, ssoadapter, subscriptions, ubt, or wsrp. For example: psadmin --help component=portal

Following are the options common to all subcommands:

component name [--help | --?]

Prints specific psadmin subcommand help page. For example, psadmin list-portals --help.

[--output | -o] filename

Redirects output to the specified file. The flag is OFF by default, and the output is displayed in the console window.

Return Values

The return value for psadmin is 0 if there is no error. Return value is 1 if there is error.

Environment Variables

psadmin supports usage of the environment variables. The environment variables are defined with prefix string "PS_ADMIN_". For example, if a command has a required option "adminuser", users can set an environment variable, PS_ADMIN_ADMINUSER, with the adminuser value. Later, while executing the command, if this option is not presented, the value from the environment variable will be used.

Multimode

psadmin supports multimode to allow executing subcommands in a batch file.

Long Format

psadmin multimode [--adminuser uid] [--passwordfile passwordfile] [--input filename]

Short Format

psadmin multimode [-u uid] [-f passwordfile] [-input filename]

If --adminuser and --passwordfile are given, the values will be saved in the environment variables, so that administrator user and password file need not to be specified in the subcommands in the input file. If --input is not specified, the command becomes interactive and allows user to input the commands. The option --printprompt is used in a scripting environment, so that no output will be displayed.

The following example shows how to use the multimode in a script:

psadmin multimode -u amadmin -f passwordfile --printprompt=false --input=inputfile

Where input file will have:

set-attribute --portal portal_id -dn default_org -m desktop

set-attribute --portal portal_id --component desktop -attribute-name AuthorizedAuthlessUserIds --add authless_user_dn | authless_user_dn

set-attribute --portal portal_id --component desktop --attribute-name EnableAuthless true

set-attribute --portal portal_id --component desktop --attribute-name DefaultAuthlessUID authless_user_dn

Prompt For Password

Most of the psadmin subcommands requires --useradmin and --passwordfile options. For security reason, customers can choose not to specify the passwordfile, and psadmin will become interactive and prompt for the password.