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.
Following Code in Powershell would give me mail id and displayname
$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?
In MSBuild you can refer to environment variables as if they were defined properties, so taking the name of the user is as simple as writing
$(USERNAME)
.