Commands › SharePoint Online

Get-SPOUser

SharePoint Online Microsoft.Online.SharePoint.PowerShell Get-*

Returns the SharePoint Online user or security group accounts that match a given search criteria.

Quick start script

# Get-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
Get-SPOUser -Site <SpoSitePipeBind> | Format-List

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

Syntax — 3 parameter sets

All (Default)

Get-SPOUser -Site <SpoSitePipeBind> [-Limit <String>] [<CommonParameters>]

ByGroup

Get-SPOUser -Site <SpoSitePipeBind> [-Group <String>] [-Limit <String>] [<CommonParameters>]

ByLogin

Get-SPOUser -Site <SpoSitePipeBind> [-LoginName <String>] [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Group String Specifies the group to get the users from.
-Limit String Specifies the maximum number of users returned. The default value is to return 500 users. To return all users specify the value "All".
-LoginName String Specifies the user name.
-Site SpoSitePipeBind yes Specifies the URL of the site collection to get the user from.

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