viva engage role member add
Assign a Viva Engage role to a user
Usage
m365 viva engage role member add [options]
Options
-i, --roleId [roleId]The id of the Viva Engage role. Specify either
roleIdorroleName, but not both.-n, --roleName [roleName]The name of the Viva Engage role. Specify either
roleIdorroleName, but not both.--userId [userId]The id of the user to be assigned to the role. Specify either
userIdoruserName, but not both.--userName [userName]The UPN of the user to be assigned to the role. Specify either
userIdoruserName, but not both.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Remarks
This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reaches general availability.
Permissions
- Delegated
- Application
| Resource | Permissions |
|---|---|
| Microsoft Graph | EngagementRole.ReadWrite.All |
| Resource | Permissions |
|---|---|
| Microsoft Graph | EngagementRole.ReadWrite.All |
Examples
Assign a user specified by id to the role specified by name.
m365 viva engage role member add --userId 7a2ca997-9461-402e-9882-58088a370889 --roleName 'Verified Admin'
Assign a user specified by UPN to the role specified by id.
m365 viva engage role member add --userName john.doe@contoso.com --roleId 77aa47ad-96fe-4ecc-8024-fd1ac5e28f17
Response
The command won't return a response on success.