Zimbra CLI Commands: User Accounts Management | Zimbra

Document
Alert! This article is written for Zimbra OSE users. As of December 2023, Synacor will no longer be providing support for Zimbra OSE. You might want to consider trying out Carbonio Community Edition – Zextras’s free and open-source email and collaboration platform.

For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.

In Zimbra, you can manage accounts by creating them and adding or changing features both from the administration console and from the Command Line Tools (CLI).

In this article, in particular, we’re going to see how to manage user accounts through CLI commands, using zmprov. For every command, we will show you the extended and short-form, the syntax to be used and an example to better help you understand how it works.

All commands are intended to be executed logging in as a Zimbra user, with the command su - zimbra

Account Provisioning Commands

Create Account

To create an account the command to use is CreateAccount or ca. Below is the syntax:

zmprov CreateAccount {user@yourdomain} {passwd} [attribute1 value1 etc]

Example:

zmprov CreateAccount john@yourdomain.com pwd123 displayName JBrown

Delete Account

To delete an account, you have to use the following command: DeleteAccount (da). Below is the syntax:

zmprov DeleteAccount {user@yourdomain|id|adminName}

Example:

zmprov DeleteAccount john@yourdomain.com

Get Account Membership

In order to get account membership, we are going to use this command: GetAccountMembership (gam). Below is the syntax:

zmprov GetAccountMembership {user@yourdomain|id}

Get Account

To get an account, you have to use the following command: GetAccount or ga. Below is the syntax:

zmprov GetAccount {user@yourdomain|id|adminName}

Example:

zmprov GetAccount john@yourdomain.com

Get All Accounts

To get all accounts, you have to use the following command: GetAllAccounts or gaa. Below is the syntax:

zmprov GetAllAccounts [-v] [{yourdomain}]

Example:

zmprov GetAllAccounts -v yourdomain.com

The -v attribute, stands for verbose. Verbose mode dumps full exception stack trace

Get All Admin Accounts

To get all admin accounts, you have to use a similar command to the above one: GetAllAdminAccounts (gaaa). Below is the syntax:

zmprov GetAllAdminAccounts

Modify Account

If you want to modify an account the command you need to use is the following one: ModifyAccount (ma). Below is the syntax:

zmprov ModifyAccount {user@yourdomain|id|adminName} [attribute1 value1 etc]

Example:

zmprov ModifyAccount john@yourdomain.com zimbraAccountStatus maintenance

Rename Account

To rename an account the command to be used is RenameAccount or ra. Below is the syntax:

zmprov RenameAccount {user@yourdomain|id} {newusername@yourdomain}

Example:

zmprov RenameAccount john@yourdomain.com john123@yourdomain.com

Set Password

If you want to set a password to your account, you have to use the following command: SetPassword (sp). Below is the syntax:

zmprov SetPassword {user@yourdomain|id|adminName} {passwd}

Example:

zmprov SetPassword john@yourdomain.com pwd123

Account Alias

You can add or remove an alias account.

To add an account alias, the command to be used is AddAccountAlias or aaa, and the syntax is:

zmprov AddAccountAlias {user@yourdomain|id|adminName} {aliasname@yourdomain}

Example:

zmprov AddAccountAlias john@yourdomain.com john.brown@yourdomain.com

To remove an account alias, the command to be used is RemoveAccountAlias or raa, and the syntax is:

zmprov RemoveAccountAlias {user@yourdomain|id|adminName} {aliasname@yourdomain}

Example:

zmprov RemoveAccountAlias john@yourdomain.com john.brown@yourdomain.com

Search Accounts

You can search accounts using the following command: SearchAccounts or sa. Below is the syntax:

zmprov SearchAccounts [-v] {ldap-query} [limit] [offset] [sortBy {attribute}]

Set Account Class of Service

To set an account COS, all you have to do is to use the command SetAccountCOS or sac with the following syntax:

zmprov SetAccountCOS {user@yourdomain|id|adminName} {cos-name|cos-id}

Example:

zmprov SetAccountCOS john@yourdomain.com SampleRole

Other Commands Related to Account Management

There are some other commands you can use when you manage accounts on your server. Here is a shortlist of the main categories of them. Click on the name of each one for a complete guide on specific commands:

Download Zextras Suite for Zimbra OSE

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Zextras Suite 3.1.9 | Blog
Zimbra CLI Commands: Distribution List | Zimbra