How to export user's profile using powershell

JT 61 Reputation points
2021-04-14T07:22:14.51+00:00

I have below scripts which able to pull out all our user's profiles with Manager. I need help on how to further enhance this to include

user's "employeeID" , & "managerUPN"

Get-AzureADUser -All $true |
Select-Object *,@{label="Manager";expression={(Get-AzureADUserManager -ObjectId $_.ObjectID).displayname}} |
Export-Csv "C:\temp\All_UsersProfiles.csv"

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2021-04-14T20:43:37.327+00:00

    Someone asked a similar question on Stack Overflow and it looks like you can get the employeeID using:

    (Get-AzureADUser -ObjectId "******@contoso.com").ExtensionProperty["employeeId"]  
    

    There's also an option in this thread that gets the ManagerUPN and exports it to a CSV.

    Get-AzureADUserManager will give you the manager of the user. https://learn.microsoft.com/en-us/powershell/module/azuread/get-azureadusermanager?view=azureadps-2.0

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.