[英]How to get LDAP displayname and email id using Msbuild?
I got communitytasks to send mail. 我有社区任务来发送邮件。 But in subject itself if i add display name of LDAP user, I would know who is taking build.
但是在主题本身中,如果我添加LDAP用户的显示名称,我会知道谁在进行构建。
Following Code in Powershell would give me mail id and displayname 在Powershell中执行以下代码会给我邮件ID和显示名
$searcher = [adsisearcher]"(samaccountname=$env:USERNAME)"
$mailid= $searcher.FindOne().Properties.mail
$DispName= $searcher.FindOne().Properties.displayname
Is there any way to get mail id and displayname in Msbuild or is it better to call powershell commands through inline task? 有什么方法可以在Msbuild中获取邮件ID和显示名称,还是通过内联任务调用Powershell命令更好?
在MSBuild中,您可以引用环境变量 ,就像它们是定义的属性一样,因此,使用用户名就像编写$(USERNAME)
一样简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.