繁体   English   中英

从AzureAD提取特定信息

[英]Extracting specific information from AzureAD

我试图从我的AzureAD网站内持有的所有用户中提取“ employeeID”。 当前我正在使用: Get-AzureADUser -ObjectId "email" | Select-Object -ExpandProperty extensionproperty 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  

我的问题是,我如何准确地提取员工信息?

由于ExtensionProperty是一个Dictionary对象,因此您需要使用以下方法从其中提取EmployeeId值:

(Get-AzureADUser -ObjectId "email").ExtensionProperty["employeeId"]

暂无
暂无

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

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