【发布时间】:2020-07-23 19:18:28
【问题描述】:
我正在尝试使用 Microsoft GraphClient sdk 获取添加到 Azure 活动目录中的用户的扩展属性。
即,我需要使用 Graph 客户端的以下命令的结果。
使用 Microsoft.Graph,版本=3.4.0.0。
PS C:\WINDOWS\system32> Get-AzureADUser -ObjectId 50413382@wingtiptoys.com |select -ExpandProperty
ExtensionProperty
Key Value
--- -----
odata.metadata https://graph.windows.net/d29b7a9b-
6edb-4720-99a8-3c5c6c3eeeb0/$metadata#directoryObjects/@Element
odata.type Microsoft.DirectoryServices.User
createdDateTime
employeeId 50413382
onPremisesDistinguishedName
thumbnailPhoto@odata.mediaEditLink directoryObjects/8cc715a1-0698-4d1a-
8f49-441a84b6dbc4/Microsoft.DirectoryServices.User/thumbnailPhoto
thumbnailPhoto@odata.mediaContentType image/Jpeg
userIdentities []
extension_10a03227b5f146ad8a0087cf0bafd627_division
|30103611|50435526|50230396|10192257|86009851
extension_10a03227b5f146ad8a0087cf0bafd627_company wingtiptoys Inc.
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute10 GF
extension_10a03227b5f146ad8a0087cf0bafd627_employeeID 50413382
extension_10a03227b5f146ad8a0087cf0bafd627_cn 50413382
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute8 wingtiptoys Inc. Inc.
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute7 Chuck
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute6 US11
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute5 US1-Rochester, NY- Site
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute4 USC
extension_10a03227b5f146ad8a0087cf0bafd627_extensionAttribute2 Regular
extension_10a03227b5f146ad8a0087cf0bafd627_employeeType ARR
感谢任何帮助。
【问题讨论】:
-
嗨 Sumith,请参考我在下面提供的解决方案。如果它对您的问题有帮助,请accept它作为答案(单击我的答案旁边的复选标记,将其从灰色切换为已填充)。先谢谢了~
-
完美。有效!!!。感谢@Hury Shen 的明确解释。
标签: c# azure-active-directory microsoft-graph-api microsoft-graph-sdks