Edit

Share via


Add-SPOUser

Adds an existing Office 365 user or an Office 365 security group to a SharePoint group.

Syntax

Default (Default)

Add-SPOUser
    -Site <SpoSitePipeBind>
    -LoginName <String>
    -Group <String>
    [<CommonParameters>]

Description

Along with the group memberships that are normally required to run Windows PowerShell, you must have the SharePoint Admin role and be a site collection administrator to use the Add-SPOUser cmdlet.

For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell.

Examples

Example 1

Add-SPOUser -Site https://contoso.sharepoint.com/sites/sc1 -LoginName joe.healy@contoso.com -Group "SC1 Owners"

Example 1 adds a user who has the e-mail address joe.healy@contoso.com to the group "SC1 Owners" in the site collection https://contoso.sharepoint.com/sites/sc1.

Example 2

Add-SPOUser -Site https://contoso.sharepoint.com -LoginName melissa.kerr@contoso.com -Group "Team Site Members"

Example 2 adds a user who has the e-mail address melissa.kerr@contoso.com to the group "Team Site Members" in the site collection https://contoso.sharepoint.com.

Parameters

-Group

Applicable: SharePoint Online

Specifies the name of the SharePoint group to add the user or the security group to.

Parameter properties

Type:System.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

-LoginName

Applicable: SharePoint Online

Specifies the login name of the user to add.

Parameter properties

Type:System.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

-Site

Applicable: SharePoint Online

Specifies the URL of the site collection to which you want to add the user.

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
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

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.