首页 > 解决方案 > GDPR 和 SharePoint 用户查找

问题描述

(不仅)因为 GDPR,当员工离开公司时,他的所有个人数据都应该被删除。应该从 Active Directory 中删除该用户和用户本身的文件。

但是,即使用户从 AD 中删除,所有“创建者”、“修改者”和其他用户字段仍然可能包含该员工的姓名,即使对于属于其他人且不应删除的文档也是如此。

如何在不破坏依赖于这些列表中(任何)有效人员信息的 SharePoint/应用程序的情况下解决此问题?

标签: sharepointlookup

解决方案


您可以从用户配置文件服务中清除用户的个人信息(姓名、电子邮件等),以便 SharePoint 仅引用他们的(希望是匿名的)用户 ID。

如有必要,您还可以使用 PowerShell 和客户端对象模型 (CSOM) 以“[已编辑]”之类的内容覆盖任何剩余信息(在网站集用户信息列表中捕获)。

请在此处参阅 Microsoft 的 SharePoint GDPR 合规性文档。

请按照以下基本步骤从 SharePoint Server 用户配置文件中删除用户的个人信息:

  1. 从馈入 SharePoint Server 用户配置文件的任何外部系统中删除用户信息。如果您使用目录同步,则必须从本地 Active Directory 环境中删除用户。

  2. 在 SharePoint Server 上运行配置文件同步。

  3. 从 SharePoint Server 中删除配置文件。完成此操作后,SharePoint Server 将在 30 天内从用户配置文件数据库中完全删除配置文件。用户的个人资料页面和个人网站将被删除。

删除用户的个人资料后,一些有限的信息(如用户 ID)可能仍会记录在用户访问过的网站集中。如果您选择从给定网站集中删除此数据,则可以使用 CSOM 来完成。下面提供了一个示例脚本:

 $username = "<admin@company.sharepoint.com>"
 $password = "password"
 $url = "<https://site.sharepoint.com>"
 $securePassword = ConvertTo-SecureString $Password -AsPlainText -Force

 # the path here may need to change if you used e.g. C:Lib.
 Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16ISAPIMicrosoft.SharePoint.Client.dll"
 Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16ISAPIMicrosoft.SharePoint.Client.Runtime.dll"

 # connect/authenticate to SharePoint Online and get ClientContext object.
 $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url)
 $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword)
 $clientContext.Credentials = $credentials
 if (!$clientContext.ServerObjectIsNull.Value)
 {
     Write-Host "Connected to SharePoint Online site: '$Url'" -ForegroundColor Green
 }

 # Get user
 $user = $clientContext.Web.SiteUsers.GetByLoginName("i:0#.f|membership|user@company.sharepoint.com")

 # Redact user
 $user.Email = "Redacted"
 $user.Title = "Redacted"
 $user.Update()
 $clientContext.Load($user)
 $clientContext.ExecuteQuery()

 # Get users
 $users = $clientContext.Web.SiteUsers

 # Remove user from site
 $users.RemoveById($user.Id)
 $clientContext.Load($users)
 $clientContext.ExecuteQuery()

推荐阅读