简体   繁体   English

如何使用Msbuild获取LDAP显示名和电子邮件ID?

[英]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.

相关问题 如何获取 PowerShell 7 上的 UWP DisplayName 属性? - How to get the UWP DisplayName property on PowerShell 7? 通过displayname而不是ID备份GPO - powershell - Backup GPO by displayname and not ID - powershell 如何在不使用 LDAP 和 PowerShell 的情况下获取用户的 FineGrainedPasswordPolicy - How to get FineGrainedPasswordPolicy of the user without using LDAP and PowerShell 获取具有显示名称的ADgroup中的所有用户 - Get all users in an ADgroup with the displayname 使用PowerShell或MSBuild获取UWP Store关联 - Get UWP Store associations using PowerShell or MSBuild Get-ADUser -Filter {displayname -like $displayname} 的奇怪结果 - Strange results with Get-ADUser -Filter {displayname -like $displayname} 如何在数据块中使用 azure SCIM api 通过 email id 删除用户? - How to delete user by email id using azure SCIM api in databricks? 使用Get-ADUser通过PowerShell(显示名称和EmployeeID)进行Active Directory导出 - Active Directory Export via PowerShell (Displayname & EmployeeID) Using Get-ADUser 如何使用 & 运算符从 PowerShell 调用 MSBuild? - How to invoke MSBuild from PowerShell using & operator? 如何使用PowerShell为MSBuild属性设置值 - How to set a value for MSBuild property using PowerShell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM