当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] OneDrive for Business:如何删除网站集管理员?

作者:精品下载站 日期:2024-12-14 15:39:14 浏览:14 分类:玩电脑

OneDrive for Business:如何删除网站集管理员?


要求:从 OneDrive for Business 管理员中删除用户。

如何从 OneDrive for Business 网站集中删除用户?

网站集管理员能够管理和管理其组织内的 OneDrive 网站。但是,在某些情况下,可能需要删除网站集管理员的角色。这可以使用 OneDrive 或 PowerShell 脚本的站点设置页面来完成!在本指南中,我们将提供有关如何使用 PowerShell 从 OneDrive for Business 删除网站集管理员的说明。

如果您是 OneDrive 网站的网站集管理员,您可以执行以下操作以从网站集管理员列表中删除用户。

  1. 登录目标 OneDrive for Business 站点 >> 单击“设置”齿轮 >> 从菜单中选择“OneDrive 设置”。
  2. 单击“更多设置”,然后单击“管理访问”下的“网站集管理员”。

    [玩转系统] OneDrive for Business:如何删除网站集管理员?

  3. 在网站集管理员列表中,您可以添加/删除用户。

    [玩转系统] OneDrive for Business:如何删除网站集管理员?

  4. 单击“确定”保存更改。
请注意,您无法从网站集中删除“所有者”。默认情况下,网站所有者会添加到网站集管理员列表中!

如果您还不是 OneDrive 的网站集管理员怎么办?

如果您没有 OneDrive for Business 网站集的网站集管理员权限,则无法执行上述步骤。因此,您可以通过以下方法使用 SharePoint 管理中心删除网站集管理员。

  1. 登录到 SharePoint Online 管理中心 https://-admin.sharepoint.com
  2. 单击“更多功能”,然后单击“用户配置文件”下的“打开”按钮
  3. 在用户配置文件服务应用程序中,单击“人员”组下的“管理用户配置文件”链接
  4. 搜索并查找要删除网站集管理员的用户。在搜索结果中,单击上下文菜单中的菜单项“管理网站集所有者”。
  5. 您可以在“网站集管理员”字段中从网站集中删除其他管理员。如果要从 OneDrive for Business 网站删除所有者,您还可以更改主网站集管理员。

    [玩转系统] OneDrive for Business:如何删除网站集管理员?

  6. 单击“确定”保存更改。

用于删除 OneDrive for Business Administrator 的 PowerShell

要删除不是 OneDrive 网站所有者的网站集管理员,请使用此 PowerShell 脚本:首先,您需要使用 Connect-SPOService cmdlet 连接到您的 SharePoint Online 租户并提供您的租户管理员凭据。连接后,您可以使用 SharePoint Online PowerShell 模块中的 Set-SPOUser cmdlet 删除 OneDrive for Business 的网站集管理员。


#Parameters
$AdminCenterURL = "https://Crescent-Admin.SharePoint.com"
$OneDriveSiteURL = "https://crescent-my.sharepoint.com/personal/salaudeen_crescent_com"
$UserAccount = "[email protected]"

#Connect to SharePoint Online
Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential)

#Get the OneDrive for Business Site
$Site = Get-SPOSite $OneDriveSiteURL

#Remove site collection admin
Set-SPOUser -Site $Site -LoginName $UserAccount -IsSiteCollectionAdmin $False

如何从租户中将用户添加为网站集管理员的所有 OneDrive 网站中删除用户?


Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

#Parameters
$AdminCenterURL = "https://crescent-admin.sharepoint.com"
$AdminAccount = "[email protected]"

Try {
    #Connect to SharePoint Online Admin Center
    Connect-SPOService -Url $AdminCenterURL -Credential (Get-Credential)

    #Get All OneDrive for Business Sites in the Tenant
    $OneDriveSites = Get-SPOSite -Limit ALL -includepersonalsite $True -Filter "Url -like '-my.sharepoint.com/personal/'"
     
    #Loop through each OneDrive Site
    Foreach($Site in $OneDriveSites)
    {
        Write-host "Scanning site:"$Site.Url -f Yellow

        #Get All Site Collection Administrators
        $SiteAdmins = Get-SPOUser -Site $Site.Url | Where {$_.IsSiteAdmin -eq $true}

        #Iterate through each admin
        Foreach($Admin in $SiteAdmins)
        {
            #Check if the Admin Name matches
            If($Admin.LoginName -eq $AdminAccount)
            {
                #Remove Site collection Administrator            
                Set-SPOUser -site $Site -LoginName $AdminAccount -IsSiteCollectionAdmin $False | Out-Null
                Write-host "`tRemoved Site Collection Admin from:"$Site.URL -f Green
            }
        }
    }
}
Catch {
    write-host -f Red "Error Removing Site Collection Admin:" $_.Exception.Message
}

要将网站集管理员添加到 OneDrive for Business 网站,如何使用 PowerShell 将网站集管理员添加到 OneDrive for Business?

结论

总之,管理 OneDrive for Business 中的网站集管理员非常重要,以确保合适的人员拥有必要的访问权限和权限来管理组织内的网站和文件。通过使用上述方法和 PowerShell 脚本,您可以轻松从 OneDrive for Business 中删除网站集管理员。总体而言,PowerShell 是管理 OneDrive for Business 网站集管理员的一种快速有效的方法,可确保组织的数据安全并得到良好维护。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯