共用方式為


Add-SPOUser

新增現有的 Office 365 使用者或 Office 365 安全性群組至 SharePoint 群組。

語法

Default (預設值)

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

Description

除了執行 Windows PowerShell 通常需要的群組成員資格,您必須具有 SharePoint 管理員 角色,並且是網站集合管理員才能使用 CmdletAdd-SPOUser

如需有關適用於 SharePoint Online 的 Windows PowerShell 權限和最新資訊,請參閱位於 SharePoint Online Management Shell 簡介的線上文件。

範例

範例 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