Add-SPOContainerUser
Adds a user to a SharePoint Embedded container with a specified role.
Syntax
Default (Default)
Add-SPOContainerUser
[-ContainerId] <String>
-LoginName <String>
-Role <String>
[<CommonParameters>]
Description
Assigns a user to a defined role within a SharePoint Embedded container.
You must be a SharePoint Embedded Administrator to run this cmdlet.
For permissions and the most current information about Windows PowerShell for SharePoint Embedded Containers, see the documentation at Intro to SharePoint Embedded Containers Management Shell.
Note
A user can be assigned to only one role within a container at a time. Owner and principal owner are distinct. A container can have multiple owners, but only one principal owner at any time. Principal ownership of a container can't be added—it can only be transferred.
Examples
Example 1
Add-SPOContainerUser b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_8U -LoginName shras@contoso.com -Role Owner
Example 1 assigns the role of owner to user with User Principal Name "shras@contoso.com".
Parameters
-ContainerId
Applicable: SharePoint Online
The unique identifier of the container to which the user is being added.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-LoginName
Applicable: SharePoint Online
The user’s login name to assign to the container. This is the User Principal Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Role
Applicable: SharePoint Online
The role to assign to the user within the container. Valid roles are:
Owner: Has full control over the container and its contents. Manager: Can add, update, and delete content, and manage permissions, but can't delete the container. Writer: Can add, update, and delete content in the container. Reader: Can only view content in the container.
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | Owner, Reader, Writer, Manager |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.