[TFS 2015]:将用户从一个 AD 域迁移到另一个

[TFS 2015]: Migrate users from one AD domain to another

我们计划将用户从我们公司的域 (domainA) 迁移到我们母公司的域 (domainB)。用户的登录 ID 将从 domainA\firstname.lastname 更改为 domainB\employee#

目前,TFS 服务器将驻留在域 A 中。

迁移我们的 TFS 用户并确保他们仍然保持当前权限的最佳方式是什么?

我确实找到了有关 Identities 命令的文档: https://docs.microsoft.com/en-us/vsts/tfs-server/admin/move-across-domains

谢谢

如果您只想在 Active Directory 中跨域迁移帐户并保持 TFS 服务器驻留在域 A 中。

您可以使用 TFSConfig Identities 命令列出或更改 TFS 部署中用户和组的安全标识符 (SID)。

首先,您的两个域之间应该存在信任关系。然后按照以下步骤操作:

  • 在新域上创建所有新帐户,不要将它们添加到 TFS
  • 以管理员身份打开命令行并导航到“C:Program FilesMicrosoft Team Foundation Server 14.0Tools

  • 运行 具有正确参数的 TFSConfig 身份,例如

    TFSConfig Identities /change /fromdomain:Domain1 /todomain:Domain2 /account:OldAccount /toaccount:NewAccount

  • 查看结果

  • 强制同步以快速检索结果或等待 同步发生在有时
  • 之后

注意:用户帐户一旦出现在 TFS 中,就无法删除或将另一个帐户映射到它。例如,如果您要将 DomainA/UserA 移动到 DomainB/UserB,Identities 命令仅在 DomainB/UserB 不存在于 TFS 中时才能迁移用户。

更多详细步骤请参考此tutorial

如果您还想将 Team Foundation Server 安装从一个域移动到另一个域,则需要完全按照说明进行操作:Move Team Foundation Server from one environment to another


来自 OP 的更新:

为了防止迁移的用户恢复到以前的帐户,我必须确保他们不属于任何 domainA 组。删除后,我运行 以下内容:

TFSServiceControl quiesce TFSConfig Identities /change /fromdomain:OldDomainName /todomain:NewDomainName /account:OldAccountName /toaccount:NewAccountName TFSServiceControl unquiesce 

然后我 运行 一个强制 AD 与 TFS 同步的 poweshell 脚本 :

 [Reflection.Assembly]::Load("Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

 # connect to the server 
  $credProvider = new-object Microsoft.TeamFoundation.Client.UICredentialsProvider $tfsConnection = new-object Microsoft.TeamFoundation.Client.TfsConfigurationServer "localhost:8080/tfs";, $credProvider $tfsConnection.EnsureAuthenticated()

 # force a full sync on the next sync execution. 
  $tfRegistry = $tfsConnection.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamFoundationRegistry]) $tfRegistry.SetValue('/Service/Integration/Settings/IdentitySyncFull', $true)

# Kick the IMS periodic job so that it syncs. 
  $jobIds = [Guid[]] @('544DD581-F72A-45A9-8DE0-8CD3A5F29DFE') $jobSvc = $tfsConnection.GetService([Microsoft.TeamFoundation.Framework.Client.ITeamFoundationJobService]) $jobSvc.QueueJobsNow($jobIds, $true)