如何获取当前/活动的 TFS 用户列表? [英] How to get list of current/active TFS users?

查看:34
本文介绍了如何获取当前/活动的 TFS 用户列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 TFSCONFIG IDENTITIES 来查看 TFS 中的所有用户,但是,这会拉出已有多年历史且不再绑定 AD 帐户的帐户.我想将搜索限制为只有拥有 AD 帐户的人.这可能吗?我确实在下面找到了博客,但在我尝试之前,我想看看是否有一个 powershell 脚本或 TFS 命令可以提供我需要的东西.谢谢.

I can use TFSCONFIG IDENTITIES to see all users in TFS, however, that pulls up accounts that are years old and no longer have an AD account tied to it. I want to limit search to only people that have an AD account. Is this possible? I did find blog below, but before I try that I wanted to see if there was a powershell script or TFS command that would provide what I needed. thanks.

https://blogs.msdn.microsoft.com/tfssetup/2013/09/18/how-to-generate-a-report-of-active-users-who-log-onto-tfs-server/

推荐答案

没有这样的 TFS 命令行可以处理这种情况.怕你要在TFS中通过collection database level才能获取相关信息.

There is no such TFS command line could handle this situation. Afraid you have to go through the collection database level in TFS to obtain related info.

您可以使用Last_Access_Time,一个示例脚本如下:

You could use Last_Access_Time, a sample script as below:

SELECT IdentityName,
StartTime,
Command,
IPAddress,
ExecutionTime
FROM tbl_Command WHERE CommandId IN
(SELECT Max(CommandId) FROM tbl_Command WHERE Application NOT LIKE 'Team Foundation JobAgent' Group By IdentityName ) ORDER BY Last_Access_Time DESC

请注意,在运行 SQL 脚本之前,您可以仔细检查是否有更改,是否有一些列不再可用,因为博客已过时.

Note, before you run the SQL script, you could double check if there are something changed, if there are some columns not available any more, since the blog is out of date.

另一种方法是在 TFS 数据库中归档 tbl_command 的内容.在 TFS 数据库中,tbl_command 捕获连接信息.默认情况下,此表仅存储 14 天的信息.你可以看看这个类似的问题:找出最近6个月内登录TFS的用户

Another way is archiving the contents of the tbl_command in the TFS databases. In the TFS databases tbl_command captures connection information. This table by default only stores 14 days of information. You could take a look at this similar question: Find out the users that has logged-in to TFS in last 6 months

您可以设置另一个数据库并有一份工作来复制信息以供长期使用.详情请参阅此样本.

You could setup another database and have a job to copy information for longer term use. Details please refer this sample.

这篇关于如何获取当前/活动的 TFS 用户列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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