Set-SPOUser

配置现有用户的属性。

语法

Default (默认值)

Set-SPOUser
    -Site <SpoSitePipeBind>
    -LoginName <String>
    [-IsSiteCollectionAdmin <Boolean>]
    [-UpdateUserTypeFromAzureAD]
    [<CommonParameters>]

说明

使用 Set-SPOUser cmdlet 配置现有用户的属性。 即,将用户作为 SharePoint Online 网站集管理员进行添加或删除。

必须至少是 SharePoint 管理员才能运行 cmdlet。

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

不支持将此 cmdlet 与 (GDAP) 的精细委派管理员权限一起使用。

示例

示例 1

Set-SPOUser -Site https://contoso.sharepoint.com/sites/marketing -LoginName melissa.kerr@contoso.com -IsSiteCollectionAdmin $true

本示例在 上https://contoso.sharepoint.com/sites/marketing创建 melissa.kerr@contoso.com SharePoint Online 网站集管理员。

示例 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上的 https://contoso.sharepoint.com/sites/benefitsSharePoint Online 网站集管理员。

参数

-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

如果在 Microsoft Entra ID中将现有用户的 UserType 属性从“成员”更改为“来宾”或“来宾”,则此参数可用于在 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