简体   繁体   English

power automatic, power bi, python 或其他自动化方式来提取给定 azure 活动目录 upn 的全名

[英]power automate, power bi, python or other automated way to extract full names given azure active directory upn

I have a dataset exported from jira into csv format containing user aliases which when combined with the known @companydomain.com suffix provide the unique aad [ azure active directory ] upn [ user principal name ] for user associated with each line item.我有一个从 jira 导出为 csv 格式的数据集,其中包含用户别名,当与已知的@companydomain.com 后缀结合使用时,可以提供唯一的 aad [ZCF04A02E37B774FC311A48F605C3C597 的活动用户目录]n

I'm looking for a d365 power automate or m365 power bi or python or other automated way to read in that csv of upn names and then talk to aad or microsoft graph to extract the associated "full name" for each user and add it as a field to the csv.我正在寻找 d365 power automatic 或 m365 power bi 或 python 或其他自动化方式来读取 csv 的 upn 名称,然后与 aad 或 microsoft graph 交谈以提取每个用户的关联“全名”并将其添加为csv 的字段。

Anyone got a solution to that scenario?有人有解决这种情况的方法吗?

sure, you can do it with power automate.当然,您可以通过电源自动化来做到这一点。 But the hardest part with power automate is to parse the csv file, as there is no built in CSV parser, there are 2 or 3 3rd party csv parsing connectors, but you need to sign up to their services to use it.但是电源自动化最困难的部分是解析 csv 文件,因为没有内置 CSV 解析器,有 2 或 3 个第三方 csv 解析器,但您需要注册他们的服务才能使用它。 or you could save it as an excel file, because power automate can read excel files.或者您可以将其保存为 excel 文件,因为电源自动化可以读取 excel 文件。

But if you can get past that part, you don't even have to do a manual graph call for it.但是,如果您可以通过该部分,您甚至不必为它进行手动图形调用。 Once you get the csv Parsed in power automate, take the information (upn) feed it into the endpoint of Get User profile (V2) put in the upn, and as select fields you can pick like surname or whatever profile parameters are there.一旦你得到 csv 在电源自动化中解析,将信息 (upn) 输入到 upn 中的获取用户配置文件 (V2) 的端点,并作为 select 字段,你可以选择姓氏或那里的任何配置文件参数。 then "create csv table" and build a csv that is identical to the csv file plus the new field, then send it as an attachment in an email to yourself. then "create csv table" and build a csv that is identical to the csv file plus the new field, then send it as an attachment in an email to yourself. where the content of the attachment is the output of the "create csv table"其中附件内容为“创建csv表”的output

Honestly, its kind of long and complicated with power automate personally.老实说,它是一种漫长而复杂的动力自动化。 If it were me, I'd just write a powershell script to do it.如果是我,我会写一个 powershell 脚本来做。

something like就像是

connect-azuread
$csvdata = import-csv -Path "whatever.csv"

foreach ($line in $csvdata){
    $displayname = (get-azureaduser -searchstring "$($line.username)@domain.com").DisplayName
    $line | add-member -notepropertyname FullName -NotePropertyValue $displayname
}
$csvdata | export-csv "whatevermodified.csv"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM