Assign security roles to a roster of users
cs_admin_assign_usersAssign security roles to many users in one Copilot Studio environment from a CSV roster or inline list, with a dry-run plan before applying changes.
Instructions
Give many users their security roles in one environment, from a CSV roster or an inline list. pac assigns one user and one role per call, so a roster of ten developers with three roles each is thirty calls; this expands the roster and runs them under a single approval. Without confirm it returns the plan: every user-and-role pair it would attempt, so you can read the whole thing before any of it happens. Rows are independent, so a bad UPN or a role the environment does not have is reported and the rest still run. Changes a live environment: requires confirm: true. Runs as the admin account: pass 'profile' or set CPS_ADMIN_PROFILE. Prefer cs_admin_assign_group when the roster is really a group: that is one call per role however many people are in it, and new joiners inherit access. Unverified against a live tenant.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No | Path to a CSV roster. Header row needs a user column (user, upn, email) and a roles column (roles, role); several roles in one cell separated by comma, semicolon or pipe. Optional businessUnit and applicationUser columns. A user on several rows accumulates their roles. | |
| confirm | No | Required to actually perform a change in a live environment. Without it the tool returns a dry run. | |
| profile | No | pac auth profile of the admin account; default CPS_ADMIN_PROFILE, then the active profile | |
| background | No | Run in the background and return a jobId immediately, then poll cs_job_status. MCP clients cut a tool call off after about 60 seconds; this operation can take much longer, and without this the work is orphaned rather than cancelled. | |
| assignments | No | Roster inline instead of a CSV file | |
| environment | Yes | Environment id or URL to assign the roles in | |
| businessUnit | No | Business unit for rows that do not name one | |
| continueOnError | No | Default true: one failed row does not abort the roster. false stops at the first failure. |