系统"?;为什么TeamCity的命令行下的亚军和QUOT执行 [英] Why does the TeamCity command line runner execute under "System"?

查看:248
本文介绍了系统"?;为什么TeamCity的命令行下的亚军和QUOT执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有点身份验证问题与TeamCity的运行命令行构建时。它涉及到有关现有问题<一href=\"http://stackoverflow.com/questions/4446283/svn-checkout-challenges-for-a-password-when-running-unattended-in-teamcity\">executing一个SVN checkout命令但我要问它明确地在这里:

为什么当TeamCity的生成代理服务配置为在特定的Active Directory帐户运行和本地系统帐户,当我执行以下命令:

 回声%USERNAME%

我得到这个构建输出:

  [20时52分04秒]:C:\\ TeamCity的\\ buildAgent \\工作\\ b67560ceb299718c&GT;回声SYSTEM
[20时52分04秒]:SYSTEM

这是真正严重破坏了我的努力下,我的广告服务帐户的身份执行命令,为什么会这样?其他构建亚军(即的MSBuild)是根据服务帐户的标识执行,这是为什么不会发生在命令行?

更新1:
在一个MSBuild脚本包装命令与Exec的目标做同样的事情 - 当前用户仍然是系统

更新2:的设置命令显示的用户名作为系统,但输出的用户配置文件指向的服务帐户的:

  [13点38分28秒]:USERDNSDOMAIN = [domain.dns名称]
[十三点38分28秒]:USERDOMAIN = [域]
[十三点38分28秒]:USERNAME = SYSTEM
[十三点38分28秒]:USERPROFILE = C:\\用户\\ [服务帐户]


解决方案

您是否尝试过重新启动服务更改了凭证后?
我的意思是双方的TeamCity服务器和生成代理

I've got a bit of an auth problem with with TeamCity when running a command line build. It's related to an existing question about executing an svn checkout command but I want to ask it explicitly here:

Why is it that when the TeamCity build agent service is configured to run under a specific Active Directory account and not the local system account, when I execute this command:

echo "%username%"

I get this build output:

[20:52:04]: C:\TeamCity\buildAgent\work\b67560ceb299718c>echo "SYSTEM" 
[20:52:04]: "SYSTEM"

This is really playing havoc with my attempts to execute commands under the identity of my AD service account, why is this happening? Other build runners (i.e. MSBuild) are executing under the identity of the service account, why is this not happening for the command line?

Update 1: Wrapping the command in an MSBuild script with an Exec target does the same thing - current user is still "System".

Update 2: The output of a "set" command is showing the username as "System" but the user profile points to that of the service account:

[13:38:28]: USERDNSDOMAIN=[domain.dns name]
[13:38:28]: USERDOMAIN=[domain]
[13:38:28]: USERNAME=SYSTEM
[13:38:28]: USERPROFILE=C:\Users\[service account]

解决方案

Have you tried restarting the service after you changed the credentials? I mean both the teamcity server and the build agent

这篇关于系统&QUOT;?;为什么TeamCity的命令行下的亚军和QUOT执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆