MJ-Tech
Well-Known Member
- Messages
- 217
- Solutions
- 25
- Reaction score
- 21
- Points
- 18
Dear Support,
I can export Azure AD users through the Azure portal or using a powershell script, but the exported CSV file only provides a few properties. Is it possible to export the values for the properties listed below from any location?
Note: I added the following line to the powershell script, however I received an empty report. "Manager" = $azuser.manager
Option :1 Azure Portal
Option :2 : Powershell script
#Connect to Azure AD #For more info - https://learn.microsoft.com/en-us/p...=azureadps-2.0#installing-the-azure-ad-module #Install-Module AzureAD Connect-AzureAD #Path sets the Output location of the CSV file. param( [string] $path = "C:\Users\<userName>\Desktop\ADUsers-$(Get-Date -format "MM-dd-yyyy").csv" ) #For Each will get all Enabled Azure AD Users and the following properties: #Employee ID, First Name, Last Name, Work Email, Job Title, Department, Management Email, License & { foreach($azuser in Get-AzureADUser -All $true -Filter 'accountEnabled eq true') { [pscustomobject]@{ "Employee ID" = $azuser.ExtensionProperty["employeeId"] "First Name" = $azuser.givenName "Last Name" = $azuser.surname "Work Email" = $azuser.UserPrincipalName "Job Title" = $azuser.JobTitle "Department" = $azuser.CompanyName "Manager Email" = (Get-AzureADUserManager -ObjectId $azuser.ObjectId).UserPrincipalName "License" = $azuser.ExtensionProperty["extension_a92a_msDS_cloudExtensionAttribute1"] } } } | Export-CSV -Path $path -NoTypeInformation
Output: Default properties value,
I can export Azure AD users through the Azure portal or using a powershell script, but the exported CSV file only provides a few properties. Is it possible to export the values for the properties listed below from any location?
- Manager
- Employee ID
- Employee type
- Employee hire date
Option :1 Azure Portal
Option :2 : Powershell script
#Connect to Azure AD #For more info - https://learn.microsoft.com/en-us/p...=azureadps-2.0#installing-the-azure-ad-module #Install-Module AzureAD Connect-AzureAD #Path sets the Output location of the CSV file. param( [string] $path = "C:\Users\<userName>\Desktop\ADUsers-$(Get-Date -format "MM-dd-yyyy").csv" ) #For Each will get all Enabled Azure AD Users and the following properties: #Employee ID, First Name, Last Name, Work Email, Job Title, Department, Management Email, License & { foreach($azuser in Get-AzureADUser -All $true -Filter 'accountEnabled eq true') { [pscustomobject]@{ "Employee ID" = $azuser.ExtensionProperty["employeeId"] "First Name" = $azuser.givenName "Last Name" = $azuser.surname "Work Email" = $azuser.UserPrincipalName "Job Title" = $azuser.JobTitle "Department" = $azuser.CompanyName "Manager Email" = (Get-AzureADUserManager -ObjectId $azuser.ObjectId).UserPrincipalName "License" = $azuser.ExtensionProperty["extension_a92a_msDS_cloudExtensionAttribute1"] } } } | Export-CSV -Path $path -NoTypeInformation
Output: Default properties value,
- userPrincipalName
- displayName
- surname
- givenName
- id
- userType
- jobTitle
- department
- accountEnabled
- usageLocation
- streetAddress
- state
- country
- officeLocation
- city
- postalCode
- telephoneNumber
- mobilePhone
- alternateEmailAddress
- ageGroup
- consentProvidedForMinor
- legalAgeGroupClassification
- companyName
- creationType
- directorySynced
- invitationState
- identityIssuer
- createdDateTime