Get-SPOUser

返回与给定搜索条件相匹配的 SharePoint Online 用户或安全组帐户。

语法

All (默认值)

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>]

说明

此 cmdlet 包含多个参数集。 只能使用一个参数集中的参数,而不能结合使用不同参数集中的参数。 有关如何使用参数集的详细信息,请参阅 Cmdlet 参数集

Get-SPOUser cmdlet 可匹配一个且唯一一个用户或安全组。

请确保至少以 SharePoint Online 管理员身份运行 Get-SPOUser cmdlet,并且是所查询网站的网站集管理员。

有关适用于 SharePoint Online 的 Windows PowerShell 的权限和最新信息,请参阅 https://go.microsoft.com/fwlink/p/?LinkId=251832 处的在线文档。

示例

示例 1

Get-SPOUser -Site https://contoso.sharepoint.com/sites/finance

示例 1 返回网站集 https://contoso.sharepoint.com/sites/finance 中的所有用户或安全组帐户。

示例 2

Get-SPOUser -Site https://contoso.sharepoint.com/sites/finance -LoginName melissa.kerr@contoso.com

示例 2 返回网站集https://contoso.sharepoint.com/sites/finance中其用户名为“”melissa.kerr@contoso.com的用户或安全组帐户。

示例 3

Get-SPOUser -Site https://contoso.sharepoint.com/sites/finance -Group "Team Site Members"

示例 3 返回网站集 https://contoso.sharepoint.com/sites/finance “Team Site Members”组中的用户或安全组帐户。

参数

-Group

适用:SharePoint Online

指定从中获取用户的组。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

ByGroup
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Limit

适用:SharePoint Online

指定返回的用户的最大数目。 默认值为返回 500 用户。 若要返回所有用户,请将值指定为“All”。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

All
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
ByGroup
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-LoginName

适用:SharePoint Online

指定用户名。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

ByLogin
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Site

适用:SharePoint Online

指定从中获取用户的网站集的 URL。

参数属性

类型:Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters