Skip to content
CBPSC edited this page Feb 16, 2017 · 7 revisions

get-user

Retrieves details about the specified user


list-users

Retrieves a list of users based on the specified criteria

DNN Prompt List-Users Command

Parameters
--email
--role
--username

  • email

  • Type: String

  • Required: Yes

  • Description: A search pattern to search for in the user's email address. You can use the asterisk ( * ) as a wildcard to signify 0 or more characters

  • role

  • Type: String

  • Required: Yes

  • Description: The name of the DNN Security Role whose members you'd like to list. IMPORTANT: wildcard searching is NOT enabled for this flag at this time. Role names are case-insensitive but spacing must match.

  • username

  • Type: String

  • Required: Yes

  • Description: A search pattern to search for in the username. You can use the asterisk ( * ) as a wildcard to signify 0 or more characters

Example usage(s): *"list-users" - Lists all users in the current portal
*"list-users [email protected]" - Lists any users with the email address of [email protected] *"list-users --username jsmith" - Lists the user with the username jsmith


new-user

Parameters
--email
--username
--displayname
--firstname
--lastname
--password
--approved
--notify

  • email

  • Type: String

  • Required: Yes

  • Description: The user's Email address.

  • username

  • Type: String

  • Required: Yes

  • Description: The user's Username.

  • displayname

  • Type: String

  • Required: No

  • Description: The display name for the user. If not specified the Display name will be the user's firstname + single space + lastname.

  • firstname

  • Type: String

  • Required: Yes

  • Description: The user's first name.

  • lastname

  • Type: String

  • Required: Yes

  • Description: The user's last name.

  • password

  • Type: String

  • Required: No

  • Default: Auto-generated

  • Description: The Password for the user account. If not specified, a random password will be generated. Note that unless you are forcing the user to reset their password, you should ensure that someone is notified of the password.

  • approved

  • Type: Boolean

  • Required: No

  • Default: True

  • Description: Whether the user account is authorized.

  • notify

  • Type: Boolean

  • Required: No

  • Default: False

  • Description: If true, the system email will be sent to the user at the user's email address. The type of email is determined by the registration type. If this is not passed, the default portal settings will be observed. If the site's registration mode is set to None, no email will be sent regardless of the value of --notify.

Example usage: "new-user --username "edoorne" --email "[email protected] --firstname "Erik" --lastname "van Doorne""


delete-user

Deletes the specified user, but the user can still be recovered as it has not yet been "purged" (a soft delete)

Parameters
--id
--notify

  • id

  • Type: Integer

  • Required: Yes

  • Description: The user's User ID. If the flag is not used, then the user's ID must be the first argument.

  • notify

  • Type: Boolean

  • Required: No

  • Default: False

  • Description: The user's User ID. If the flag is not used, then the user's ID must be the first argument.

Example usage: "delete-user 345 --notify true" - Deletes the user with user id of 345 and sends a notification email to the user


purge-user

Permanently deletes the user that has previously been marked as "deleted" (a hard delete)

Parameters
--id

  • id
  • Type: Integer
  • Required: Yes
  • Description: The user's User ID. If the flag is not used, then the user's ID must be the first argument.

Example usage: "purge-user 345" - Permanently deletes the user with user id 345.


restore-user

Recovers a user that is marked as "deleted" (soft-deleted) but has not yet been purged

Parameters
--id

  • id
  • Type: Integer
  • Required: Yes
  • Description: The user's User ID. If the flag is not used, then the user's ID must be the first argument.

Example usage: "restore-user 345" - Restores the user with id 345. If the user hasn't been deleted, you will receive a message indicating there is nothing to restore. If the user has already been purged (or 'removed' via DNN's user interface, you will receive a 'user not found' message.


add-roles

Add one or more DNN Security Roles to a user

Parameters
--id
--roles

  • id

  • Type: Integer

  • Required: Yes

  • Description: User ID of user to which the roles will be added.

  • roles

  • Type: String

  • Required: Yes

  • Description: Comma-delimited string of DNN role names to apply to user.

Example usage: "add-roles 87 --roles "Content Creators, All Users" - Adds the roles "Content Creators" and "All Users" to the user with the id of 87.


reset-password

Sends a reset password email to the user

Parameters
--id

  • id
  • Type: Integer
  • Required: Yes
  • Description: User ID of user to send Reset Password link to.

Example usage: "reset-password 87" - Sends a password reset email to the user with user id 87