This sample PowerShell script shows how to export all Data in Intune that is related to a specific user.
Some script samples retrieve information from your Intune tenant, and others create, delete or update data in your Intune tenant. Understand the impact of each sample script prior to running it; samples should be run using a non-production or "test" tenant account.
Within this section there are the following scripts with the explanation of usage.
The script exports Intune data related to the specific user.
Export-IntuneData.ps1 -Username admin@contoso.com -Upn user@contoso.com -OutputPath c:\export\userNote that this script requires either the AzureAD or AzureADPreview PowerShell modules installed. To install the module you can run:
Install-Module AzureAD -Scope CurrentUserHere is a description of the parameter you can pass the script:
| Parameter | Required? | Description |
|---|---|---|
| Username | Yes | Azure AD Username for the Administrator |
| Upn | Yes | User principal name to export data for |
| IncludeAzureAD | No | Include Azure AD data in the export |
| IncludeNonAzureADUpn | No | Include data For Non Azure AD Upn in export |
| All | No | Include all data in the export |
| OutputPath | Yes | Path to export data to |
| ExportFormat | No | Format to export data in, default value is json, other supported values are xml and csv |
https://aka.ms/intunedataexport
- Download both the PS1 file and the ExportConfiguration.json file from the script location
- Run, Install-Module AzureAD -Scope CurrentUser
- Navigate to the folder that contains the PowerShell script Export-IntuneData.ps1
- Run the export script (see example below): UserName is the Tenant Admin User Name and UPN is the Target User (Data Subject) for whom you want to export the data
.\Export-IntuneData.ps1 -UserName admin@contoso.onmicrosoft.com -UPN adamprice@contoso.onmicrosoft.com -Outputpath c:\IntuneExport\- Navigate to export folder to see exported files
The following tables lists how to interpret the data found in the JSON files generated by the export script
This file captures the User Specific information retained in the Service. Data below is representative of the results of an export operation. Not all possible values are shown. See actual results for full list.
| Value | Example | Description |
|---|---|---|
| DisplayName | Adam Price |
Display Name of the User |
| PrimarySMTPAddress | adamprice@contoso.com |
SMTP Address |
| UPN | adamprice@contoso.exchange.com |
User Principal Name |
| UserEmail | adam@contoso.com |
User’s email id (if available) |
| UserIdentity | 1234567890abcdef@microsoftonline.com |
Organizational Personal Identifier |
| OnPremisesUpn | adamprice@contoso.exchange.com |
UPN synced from ActiveDirectory to Azure Active Directory. In most cases this will be the same as the UPN |
| AzureADTenantId | 0e987367-3209-4bd5-a728-d0e4f4a4a3b5 |
Internal Representation of the Tenant the user is associated with |
| UserId | f146ab3e-825e-4f22-ab01-983cf8390524 |
The internal representation of the AAD User |
This file captures the Managed Device Specific information retained in the Service. Data below is representative of the results of an export operation. Not all possible values are shown. See actual results for full list.
| Value | Example | Description |
|---|---|---|
| ID | 5596f49c-c0bf-4cbb-baf3-dc11090dec05 |
Internal identifier of the device |
| DeviceName | Adam Price test device |
Actual name of the device enrolled in the service |
| UserEmail | adam@contoso.com |
User's email id (if available) |
| HardwareInformation | See actual results for full list. Representative examples include: |
The available information about the device enrolled in the service |
| OnPremisesUpn | adamprice@contoso.exchange.com |
UPN synced from ActiveDirectory to Azure Active Directory. In most cases this will be the same as the UPN |
| AzureADTenantId | 0e987367-3209-4bd5-a728-d0e4f4a4a3b5 |
Internal Representation of the Tenant the user is associated with |
| UserId | f146ab3e-825e-4f22-ab01-983cf8390524 |
The internal representation of the AAD |
| DetectedApps | See actual results for full list. Representative examples include:"id": "3d413fb3d8ed45798213fb3d8ed457982d09d57a1c62928","displayName": "Company Portal","version": "5.0.3667.0" |
Details of the Apps installed on the Device |
| DeviceConfigurationStates | See actual results for full list. Representative examples include:"id": "585285f6-b26a-4fdf-806b-96d34748ab3f","setting": "AndroidWiFiConfiguration","state": "compliant","errorDescription": "No error code","sources": [{ "id": "4f7102c7-1a28-44f8-bd3c-51aa2371e38f", "displayName": "Contoso Office Guest" }] |
Specifics about the Device Configuration and the state against these configurations. IDs in this section are internal representations of the Configuration Setting |
| DeviceCompliancePolicyStates | See actual results for full list. Representative examples include:"id": "5079ffb4-057a-4b8f-8dc1-66279a2b8244","setting": "DefaultDeviceCompliancePolicy.RequireUserExistence","state": "compliant" |
Specifics about the Device Configuration and the state against these configurations. IDs in this section are internal representations of the Compliance Polices |
This file captures the information pertaining to the Apps as retained in the Service. Data below is representative of the results of an export operation. Not all possible values are shown. See actual results for full list.
| Value | Example | Description |
|---|---|---|
| ID | 7351edd8-942f-4a6a-abfa-9eedd796b2fa |
Internal ID for the Application |
| AutoAcceptEula | true |
Flag to determine whether the EULA is auto accepted or not |
| DeviceStatuses | See actual results for full list. Representative examples include:"id": "7351edd8-942f-4a6a-abfa-9eedd796b2fa09c7bb08-b7bb-47ca-9c6b-86761df25504","deviceName": "DESKTOP","deviceId": "09c7bb08-b7bb-47ca-9c6b-86761df25504","userPrincipalName": "adamprice@contoso.onmicrosoft.com" |
IDs in this section represent the internal representations of Devices, Application IDs etc. |
| UserStatuses | See actual results for full list. Representative examples include:"id": "7351edd8-942f-4a6a-abfa-9eedd796b2fa1361ab99-a7f8-479e-9292-6195c369e097","userPrincipalName": "adamprice@contoso.onmicrosoft.com" |
IDs in this section represent the internal representations of UserIDs etc. |
| productIDs | o365ProPlusRetail | Lists the name(s) of the product installed |
This file captures the User Specific information retained in the Service. Data below is representative of the results of an export operation. Not all possible values are shown. See actual results for full list.
| Value | Example | Description |
|---|---|---|
| EASID | F91F9EA87EB7425694DBD208A286A22C |
Internal ID of the mail client matched to this device |
| EthernetMacAddress | 001122334455 |
MAC Address captured |
| NetBiosName | DESKTOP |
Device name |
| DeviceSettings | See actual results for full list. Representative examples include:"Key": "5596f49c-c0bf-4cbb-baf3-dc11090dec05","ClientCertificate":"ABCdefGHIjkl123456" |
Setting and values of the device |
| DeviceActions | See actual results for full list. Representative examples include:"EnrolledByUser": "1361ab99-a7f8-479e-9292-6195c369e097","ReferenceId": "2bf669f2-b844-4ee1-bd98-764f0f0172fd" |
EnrolledByUser ID is the internal identifier for the user whose device has been enrolled ReferenceID is the identifier that is used by AAD to track the history of the Device |
| DevicePhysicalIDs | "PurchaseOrderId=ae546f95-cc3c-4eea-8517-b19ced841f88", "OrderId=fefe5b45-f8de-4cc0-ac2c-c6163c66bd3e","ZtdId=a188f0e7-52ff-4bae-bb43-991f92c80add" |
Identifiers used in Windows 10 April update for devices |
| ExchangeActivationItems | See actual results for full list. Representative examples include:,"Source": "eas","ReferenceId": "2bf669f2-b844-4ee1-bd98-764f0f0172fd","EasId": "EE66FF085DAE23B0BE50C394774A69C6","UserId": "1361ab99-a7f8-479e-9292-6195c369e097" |
The properties in this section are used to link the Device with the EAS ID (Internal ID of the mail client this device is associated with) |
| SerialNumber | 1234-5678-9012-3456-7890-1234-56 |
Serial no of the device |
| PhoneNumber | 555-123-1234 or ***-***-1234 |
Phone number associated with the device as per policy applicable for Corporate vs Personal device |
| MSADeviceId | 00000000-0000-0000-0000-000000000000 |
Internal representation of the Microsoft Account ID |
| ActualEasIdFromActivationItem | F91F9EA87EB7425694DBD208A286A22C |
The EAS ID from the most recent entry in the ExchangeActivationItems collection |
| DeviceId | 09c7bb08-b7bb-47ca-9c6b-86761df25504 |
Internal representation ID of the Device |
This file captures the User Specific information retained in the Service. Data below is representative of the results of an export operation. Not all possible values are shown. See actual results for full list.
The zip file contains the ChromeOS Devices Report information pertaining to the relevant UPN. Note, the UPN does not need to correspond to an AzureAD user.