Add-SPOUser

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

Syntax

Add-SPOUser
   -Group <String>
   -LoginName <String>
   -Site <SpoSitePipeBind>
   [<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

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-LoginName

Specifies the login name of the user to add.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Site

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

Type:SpoSitePipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online