我正在尝试使用以下命令获取工作区列表:
tf workspaces /collection:url /computer:* /owner:* /format:xml > workspacesxml.xml
我在哪里更换
url
使用我的组织帐户的 Azure DevOps URL。问题是它提示:
TF30063: You are not authorized to access
我已经清除了 Windows 凭据,重新启动并重试,但没有成功。使用
/login:username,password
不是一个选项,因为我启用了 2FA。如何重新登录命令行 (CMD) 或注销 TF.exe?
最佳答案
您的错误显然是无权连接远程 url。如果它没有缓存在本地,则需要在命令行中指定包含的身份验证。
根据您的描述the Azure DevOps URL of my organization account.
看来您使用的是 Azure DevOps 服务,而不是本地 TFS。平时/登录 选项可用于本地 TFS,我们使用 /登录 选项指定运行命令的 Team Foundation Server 用户帐户。
如果要在 Azure DevOps 服务上使用 tf.exe,则需要 使用 PAT token .命令行是:
tf workspaces /collection:https://xxxx.visualstudio.com /login:PATtoken
添加截图:
使用个人访问 token (PAT) 的详细信息 是备用密码 可用于在 Azure DevOps 中进行身份验证。使用时,只需将用户名留空并使用PAT token 输入密码即可。
使用时请导航至
https://tfsurl/{teamprojectcollection}/_usersSettings/tokens
,并确保您的 PAT 仍在有效期内。如果没有,请单击“新 token ”按钮创建新 token 。更多详情请查看我们的官方链接-- Authenticate access with personal access tokens
关于cmd - tf.exe 提示 "TF30063: You are not authorized to access ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58609089/