以下是TFS 2013更新5
** WARNING ** Getting caught editing the TFS database directly
** will void your Microsoft Support Agreement. **
What follows is not for the uninitiated. ** Proceed at your own risk. **
找到该用户或用户的电子邮件地址需要进行设置。在Identities
表中可能有重复项。我发现最高SequenceId
的那些是活动的Identities
。
Use Tfs_TFSConfiguration
SELECT i1.AccountName, i1.Id FROM tbl_Identity AS i1
LEFT OUTER JOIN tbl_Identity AS i2
ON (i1.AccountName=i2.AccountName AND i1.SequenceId<i2.SequenceId)
WHERE i2.AccountName IS NULL
AND i1.AccountName in ('<your first user>','<another user>','<and so on>')
这给最近的列表Id
(S),在GUID形式,你需要更新账户。这些GUID必须重新格式化为ArtifactId
(s),这是一种转换后的二进制格式。这是通过颠倒字节顺序(从低到高)或GUID的前三个部分中的每一个来完成的,但是将最后两个部分依次排列。例如: -
Returned 'Id' GUID =01020304-0506-0708-090A-0B0C0D0E0F10
Byte Swapped GUID =04030201-0605-0807-090A-0B0C0D0E0F10
Reformatted 'ArtifacId'=0x0403020106050807090A0B0C0D0E0F10
接下来,你必须要找到的电子邮件通知使用TFS PropertyId
(S)。在TFS 2013 U5,这可以用下面的查询中找到:
USE Tfs_TFSConfiguration
SELECT Name, PropertyId FROM tbl_PropertyDefinition WHERE Name LIKE '%Address%'
这会给你ConfirmedNotificationAddress
和CustomNotificationAddresses
的PropertyId
(S);这是TFS 2013 U5用于发送通知电子邮件的两个属性字段。
接下来,你必须要找到InternalKindId
为Identity
框架的TFS DatabaseCategory
USE Tfs_TFSConfiguration
SELECT Description, InternalKindId FROM tbl_PropertyArtifactKind
WHERE Description='Identity'
我们把它放在一起,...
如果您的用户配置记录(S )已经存在,您可以用更新的设置:
USE Tfs_TFSConfiguration
UPDATE tbl_PropertyValue SET LeadingStringValue='<user's notification email address>'
WHERE ArtifactId=<ArtifactId, reformatted from tbl_Identity query>
AND PropertyId IN ('<first PropertyId from tbl_PropertyDefinition>', '<second id>')
注:ArtifactId
是基于半字节交换的数据库GUID的二进制值,并且与UPDATE
查询中的引用值不匹配。 I.e.查询的这部分看起来像:
WHERE ArtifactId=0x90D490F6BF7B31491CB894323F38A91F AND
下面我假设PartitionId
为“1”;在继续对tbl_PropertyValue
表中的记录进行简短扫描之前,应验证这一点。
如果要加载尚未设置配置设置:
USE Tfs_TFSConfiguration
INSERT INTO tbl_PropertyValue
(PartitionId, ArtifactId, InternalKindId, Version, PropertyId, LeadingStringValue)
VALUES ('1', <ArtifactId, reformatted from tbl_Identity query>,
'<InternalKindId from tbl_PropertyArtifactKind>',
'0',
'<first PropertyId from tbl_PropertyDefinition>',
'<user's notification email address>'),
('1', <ArtifactId, reformatted from tbl_Identity query>,
'<InternalKindId from tbl_PropertyArtifactKind>',
'0',
'<second PropertyId from tbl_PropertyDefinition>',
'<user's notification email address>')
注:是ArtifactId
必须是带引号的二进制值,从GUID转化从tbl_Identity
返回如上所述。
注意:即为每个ArtifactId
创建两个记录,每个PropertyId
一个。
** WARNING ** Getting caught editing the TFS database directly
** will void your Microsoft Support Agreement. **
** Proceed at your own risk. **
(这对我的作品,... 但是,我没有微软支持协议无效。)
感谢详细的解答。这些都是好消息。所以,现在,只要构建版本发布,我就可以自动发送电子邮件给每个团队成员。 :) – Christian 2012-02-10 08:25:50
如果TFS未连接到AD,是否真的没有办法管理用户的电子邮件地址?任何可以做这种事情的插件,API或类似的东西? – Xorandor 2012-02-10 13:10:56
正确 - 在TFS 2005,TFS 2008和TFS 2010中。用户可以通过Team Web Access中的Profile Management更新他们在下一个TFS版本中的通知电子邮件地址,但我不太确定是否会有一个UI暴露给管理员来更新它们。下一个版本的TFS还没有完成,所以我们会看到!如果以可以通过API编辑的方式存储,那么有人可能会构建一个自定义工具来执行此操作。 – 2012-02-10 21:14:33