mongocli iam orgs users list
On this page
The mongocli iam orgs users list
command lists users in your
MongoDB service organization. You can also list the users in
your MongoDB service organization using the:
Permissions Required
The following table lists the roles you must have to retrieve the users in your MongoDB service organization.
MongoDB Service | Role |
---|---|
Atlas | |
Cloud Manager | |
Ops Manager |
Syntax
mongocli iam orgs users list [ --limit <integer> ] [ --orgId <organization-ID> ] [ --output|-o <output-format> ] [ --page <integer> ] [ --profile|-P <profile-name> ]
Note
Use -h
or --help
to view the command-line help for
this command.
Options
Option | Type | Description | Required? |
---|---|---|---|
--limit | integer | Number of projects to return from the result set.
| no |
--orgId | string | Unique identifier of the organization for which you want to
retrieve the users. If omitted, uses the specified profile
to access the MongoDB service organization. | no |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--page | integer | Starting chunk of projects to return from the result set. The
| no |
--profile , -P | string | Name of the profile that contains the access information. If
omitted, uses the default profile. | no |
Output
The command prints the following output to the terminal if the command succeeds. If the command returns errors, see Troubleshooting for recommended solutions.
ID FIRST NAME LAST NAME USERNAME <user-ID> <first-name> <last-name> <username>
The above default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the API reference for your MongoDB service:
Example
The following command lists the users in the specified Ops Manager organization. It uses the default profile for accessing Ops Manager.
mongocli iam orgs users list --orgId 5df27c15f10fab55fc6c1234
The previous command prints the following in the default format to the terminal. For more information on these fields, see Output.
ID FIRST NAME LAST NAME USERNAME 5f6e2c02a2dcef512bf0f169 John Doe john.doe@example.com
The following command lists the users in an Atlas organization. It
uses the profile named atlasProfile
for accessing Atlas.
mongocli iam orgs users list --profile atlasProfile --output json
The previous command prints the following in the specified format to the terminal. For more information on these fields, see Output.
{ "links": [ { "rel": "self", "href": "http://cloud.mongodb.com/api/public/atlas/v1.0/orgs/5f6e2caba2dcef512bf0f32d/users?pageNum=1\u0026itemsPerPage=100" } ], "results": [ { "id": "5f6e2c02a2dcef512bf0f169", "emailAddress": "john.doe@example.com", "firstName": "John", "lastName": "Doe", "roles": [ { "groupId": "5e399b9a7a3e5a1772948493", "roleName": "GROUP_OWNER" }, { "orgId": "5dd6fa0c7a3e5a1d0fa27e35", "roleName": "ORG_OWNER" } ], "username": "john.doe@example.com" } ], "totalCount": 1 }