我试图从我的AzureAD网站内持有的所有用户中提取“ employeeID”。目前,我正在使用:Get-AzureADUser -ObjectId "email" | Select-Object -ExpandProperty extensionproperty
这有效并获取了我的employeeID,但是,它还提取了其他信息
输出:
Key Value
--- -----
odata.metadata https://graph.windows.net/0a138b97-aedc-4e06-875a-44803cfcd8c1/$metadata#dir...
odata.type Microsoft.DirectoryServices.User
createdDateTime 20/03/2019 10:47:23
employeeId x
onPremisesDistinguishedName x
userIdentities []
extension_dfb221e9879e4fa2bd42bc4c8f90eeed_employeeID x
我的问题是,我应该如何准确地提取员工信息?
答案 0 :(得分:1)
由于ExtensionProperty
是一个Dictionary对象,因此您需要使用以下方法从该值中提取EmployeeId
:
(Get-AzureADUser -ObjectId "email").ExtensionProperty["employeeId"]