question

JyhGuangTEE-0960 avatar image
0 Votes"
JyhGuangTEE-0960 asked MarileeTurscak-MSFT answered

How to export user's profile using powershell

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"

azure-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MarileeTurscak-MSFT avatar image
0 Votes"
MarileeTurscak-MSFT answered

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

 (Get-AzureADUser -ObjectId "Andre@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://docs.microsoft.com/en-us/powershell/module/azuread/get-azureadusermanager?view=azureadps-2.0


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.