Add-SPOUser

向 SharePoint 组添加现有 Office 365 用户或 Office 365 安全组。

语法

Default (默认值)

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

说明

除了通常运行Windows PowerShell所需的组成员身份之外,还必须具有 SharePoint 管理员 角色,并且必须是网站集管理员才能使用该 Add-SPOUser cmdlet。

有关适用于 SharePoint Online 的 Windows PowerShell 的权限和最新信息,请参阅在线文档简介 SharePoint Online 命令行管理程序的简介

示例

示例 1

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

示例 1 将电子邮件地址的用户 joe.healy@contoso.com 添加到网站集中的“SC1 所有者”组 https://contoso.sharepoint.com/sites/sc1.

示例 2

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

示例 2 将具有电子邮件地址 melissa.kerr@contoso.com 的用户添加到网站集中的组“工作组网站成员” https://contoso.sharepoint.com.

参数

-Group

适用:SharePoint Online

指定要将用户或安全组添加到的 SharePoint 组的名称。

参数属性

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

参数集

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

-LoginName

适用:SharePoint Online

指定要添加的用户的登录名。

参数属性

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

参数集

(All)
Position:Named
必需:True
来自管道的值: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