Commands › SharePoint Online

Add-SPOUser

SharePoint Online Microsoft.Online.SharePoint.PowerShell Add-*

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

Quick start script

# Add-SPOUser — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Run and inspect
Add-SPOUser -Group <String> -LoginName <String> -Site <SpoSitePipeBind> | Format-List

# 3. Export for evidence / drift tracking
Add-SPOUser | Export-Clixml .\SPOUser-$(Get-Date -Format yyyyMMdd).xml

Syntax

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

Parameters (3)

ParameterTypeRequiredWhat it controls
-Group String yes Specifies the name of the SharePoint group to add the user or the security group to.
-LoginName String yes Specifies the login name of the user to add.
-Site SpoSitePipeBind yes Specifies the URL of the site collection to which you want to add the user.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.