Set-SPOUser
設定現有使用者的屬性。
語法
Default (預設值)
Set-SPOUser
-Site <SpoSitePipeBind>
-LoginName <String>
[-IsSiteCollectionAdmin <Boolean>]
[-UpdateUserTypeFromAzureAD]
[<CommonParameters>]
Description
使用 Set-SPOUser Cmdlet 可設定現有使用者的屬性。
也就是說,新增或移除身為 SharePoint Online 網站集合系統管理員的使用者。
您必須至少是 SharePoint 系統管理員才能執行 Cmdlet。
如需有關適用於 SharePoint Online 的 Windows PowerShell 權限和最新資訊,請參閱位於 SharePoint Online Management Shell 簡介的線上文件。
不支援使用此 Cmdlet 搭配 (GDAP) 精細委派的系統管理員權限使用。
範例
範例 1
Set-SPOUser -Site https://contoso.sharepoint.com/sites/marketing -LoginName melissa.kerr@contoso.com -IsSiteCollectionAdmin $true
此範例會讓 melissa.kerr@contoso.com SharePoint Online 網站集合系統管理員位於 https://contoso.sharepoint.com/sites/marketing。
範例 2
Set-SPOUser -Site https://contoso.sharepoint.com/sites/benefits -LoginName adelev_fabrikam.onmicrosoft.com#ext#@contoso.onmicrosoft.com -IsSiteCollectionAdmin $true
此範例會讓來賓使用者adelev_fabrikam.onmicrosoft.com 上 SharePoint Online 網站集合系統管理員 https://contoso.sharepoint.com/sites/benefits。
參數
-IsSiteCollectionAdmin
適用對象:SharePoint Online
指定使用者是否為網站集合系統管理員。
參數屬性
| 類型: | System.Boolean |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | 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 |
-UpdateUserTypeFromAzureAD
如果現有使用者的 UserType 屬性在 Microsoft Entra ID 中從成員變更為來賓,反之亦然,此參數可用來在 SharePoint Online 中更新它。 如需詳細資訊,請參閱轉換 UserType。
參數屬性
| 類型: | System.Management.Automation.SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
CommonParameters
此 Cmdlet 支援常見參數: -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。