【问题标题】:Office365 - How to retrieve UPN using ImmutableId in powershell?Office365 - 如何在 powershell 中使用 ImmutableId 检索 UPN?
【发布时间】:2016-08-30 19:48:28
【问题描述】:

我有一个 Office 365 用户的 immutableid。如何使用powershell检索对应用户的UPN?

【问题讨论】:

    标签: powershell office365 azure-powershell


    【解决方案1】:

    在 Powershell 中,您可以使用对象标识符在 Azure AD 中查询用户。

    $msolcred = get-credential
    connect-msolservice -credential $msolcred
    get-msoluser -ObjectId "{guid:object_identifier}"
    

    UPDATE#1:通过 ImmutableId 查询用户

    get-msoluser | Where-Object {$_.ImmutableId -eq "zYGi36Y8tkCwX4lYBb8bUA=="}
    

    更新#1:

    不使用 PowerShell get-msoluser 模块,另一种选择是使用 Microsoft Graph API:

    https://graph.microsoft.com/v1.0/users?$filter=onPremisesImmutableId+eq+'zYGi36Y8tkCwX4lYBb8bUA=='
    

    【讨论】:

    • 感谢您的回复。但我只有 immutableid 而不是 o365 用户的 objectid。
    • 您好 Jeffrey,我最终只使用了上述 cmdlet。但是我认为没有处理 o365 中的所有用户,有没有直接的方法来检索具有 immutableid 的用户。因为上面的 cmdlet 涉及扫描所有用户,如你所知..
    • @Praveen,对于新功能请求,您可以在 Azure Active Directory 反馈中提交反馈:feedback.azure.com/forums/169401-azure-active-directory
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-03
    • 1970-01-01
    • 1970-01-01
    • 2023-02-19
    • 2019-10-08
    • 1970-01-01
    相关资源
    最近更新 更多