TFS Windows 计算机文件复制所需的安全性
Security needed for TFS Windows Machine File Copy
我在使用 TFS 2015 中的 windows 机器文件复制时遇到一些问题。
我们正在使用机器文件复制将我们的工件移动到 Web 服务器,然后 运行ning IIS 部署。当它在我的凭据下 运行 时,这工作正常。但是,当我尝试 运行 它使用本地计算机上的管理员时,我收到以下错误。
2017-08-03T09:26:52.4173924Z ROBOCOPY :: Robust File Copy
for Windows
2017-08-03T09:26:52.4173924Z
------------------------------------------------------------------------------- 2017-08-03T09:26:53.6518030Z Started : 03 August 2017 10:26:52
2017-08-03T09:26:53.6518030Z 2017/08/03 10:26:53 ERROR 5 (0x00000005)
Getting File System Type of Destination \Server\C$\Deployment
Folder\Release\ 2017-08-03T09:26:53.6518030Z Access is denied.
2017-08-03T09:26:53.6518030Z Source :
C:\Agent\agent_workf953eca\Release CI
Test\drop_PublishedWebsites\Site_Package\
2017-08-03T09:26:53.6518030Z Dest - \Server\C$\Deployment
Folder\Release\ 2017-08-03T09:26:53.6518030Z Files : .
2017-08-03T09:26:53.6518030Z 2017-08-03T09:26:53.6674336Z
Options : . /S /E /DCOPY:DA /COPY:DAT /B /R:1000000 /W:30
2017-08-03T09:26:53.6674336Z
------------------------------------------------------------------------------ 2017-08-03T09:26:53.9643156Z 2017/08/03 10:26:53 ERROR 5 (0x00000005)
Creating Destination Directory \Server\C$\Deployment Folder\Release\
2017-08-03T09:26:53.9643156Z Access is denied.
2017-08-03T09:26:53.9955634Z \Serverwas deleted successfully.
2017-08-03T09:26:54.0268146Z ##[error]Copying failed for resource :
Server 2017-08-03T09:26:54.0268146Z ##[error]Copying failed. Consult
the robocopy logs for more details.
我了解到要执行 windows 机器文件复制,管理员用户只需要对目标服务器具有管理员访问权限,他们实际上是否也需要对构建服务器具有访问权限?
这可能是一个问题的原因是某些服务器位于 DMZ 内,因此无法访问我们的 Active Directory。我不明白我怎么能让一个用户对我们网络中的服务器和 DMZ 中的服务器具有管理员访问权限。如果是这种情况,我想知道如何使用 TFS 发布管理将我们的工件部署到这些服务器。
对于 Windows 机器文件复制任务中的 Access is denied
错误。正如上面讨论的评论,您需要为服务帐户在 Web 服务器上的共享文件夹提供足够的权限。
至于使用本地管理员帐户部署到 DMZ 中的服务器。有两个选项:
Option 1 - using WMF-v5 and a PowerShell task
To send files over a WinRM session in WMF v5 you can use the Copy-Item
cmdlet. For example,
$session = New-PSSession -ComputerName <computername>
Copy-Item <yourfile> -Destination 'C:' -ToSession $session
Option 2
Do the machines in DMZ have line-of-sight to TFS on-premises? If yes,
the simplest like Daniel suggested, you could deploy an agent on the
servers and configure it with the TFS. You can use similar shadow
accounts approach to configure the agents with the TFS.
Once configured, the agents auto download the associated artifacts to
local machine.
更多细节请参考Roopesh Nair's在这个问题中的回答:TFS 2015 Update 2 Release Management - Deploying across untrusted domains and to servers in the DMZ
我在使用 TFS 2015 中的 windows 机器文件复制时遇到一些问题。
我们正在使用机器文件复制将我们的工件移动到 Web 服务器,然后 运行ning IIS 部署。当它在我的凭据下 运行 时,这工作正常。但是,当我尝试 运行 它使用本地计算机上的管理员时,我收到以下错误。
2017-08-03T09:26:52.4173924Z ROBOCOPY :: Robust File Copy for Windows
2017-08-03T09:26:52.4173924Z ------------------------------------------------------------------------------- 2017-08-03T09:26:53.6518030Z Started : 03 August 2017 10:26:52
2017-08-03T09:26:53.6518030Z 2017/08/03 10:26:53 ERROR 5 (0x00000005) Getting File System Type of Destination \Server\C$\Deployment Folder\Release\ 2017-08-03T09:26:53.6518030Z Access is denied.
2017-08-03T09:26:53.6518030Z Source : C:\Agent\agent_workf953eca\Release CI Test\drop_PublishedWebsites\Site_Package\
2017-08-03T09:26:53.6518030Z Dest - \Server\C$\Deployment Folder\Release\ 2017-08-03T09:26:53.6518030Z Files : .
2017-08-03T09:26:53.6518030Z 2017-08-03T09:26:53.6674336Z
Options : . /S /E /DCOPY:DA /COPY:DAT /B /R:1000000 /W:30
2017-08-03T09:26:53.6674336Z ------------------------------------------------------------------------------ 2017-08-03T09:26:53.9643156Z 2017/08/03 10:26:53 ERROR 5 (0x00000005) Creating Destination Directory \Server\C$\Deployment Folder\Release\ 2017-08-03T09:26:53.9643156Z Access is denied.
2017-08-03T09:26:53.9955634Z \Serverwas deleted successfully.
2017-08-03T09:26:54.0268146Z ##[error]Copying failed for resource : Server 2017-08-03T09:26:54.0268146Z ##[error]Copying failed. Consult the robocopy logs for more details.
我了解到要执行 windows 机器文件复制,管理员用户只需要对目标服务器具有管理员访问权限,他们实际上是否也需要对构建服务器具有访问权限?
这可能是一个问题的原因是某些服务器位于 DMZ 内,因此无法访问我们的 Active Directory。我不明白我怎么能让一个用户对我们网络中的服务器和 DMZ 中的服务器具有管理员访问权限。如果是这种情况,我想知道如何使用 TFS 发布管理将我们的工件部署到这些服务器。
对于 Windows 机器文件复制任务中的 Access is denied
错误。正如上面讨论的评论,您需要为服务帐户在 Web 服务器上的共享文件夹提供足够的权限。
至于使用本地管理员帐户部署到 DMZ 中的服务器。有两个选项:
Option 1 - using WMF-v5 and a PowerShell task
To send files over a WinRM session in WMF v5 you can use the Copy-Item cmdlet. For example,
$session = New-PSSession -ComputerName <computername> Copy-Item <yourfile> -Destination 'C:' -ToSession $session
Option 2
Do the machines in DMZ have line-of-sight to TFS on-premises? If yes, the simplest like Daniel suggested, you could deploy an agent on the servers and configure it with the TFS. You can use similar shadow accounts approach to configure the agents with the TFS.
Once configured, the agents auto download the associated artifacts to local machine.
更多细节请参考Roopesh Nair's在这个问题中的回答:TFS 2015 Update 2 Release Management - Deploying across untrusted domains and to servers in the DMZ