Get-MgDeviceManagementManagedDevicel does not return proper value for EthernetMacAddress
Describe the bug
I am building a export of Intune devices , using PowerShell: $devices = Get-MgDeviceManagementManagedDevice -All
Expected behavior
I expect a range of values for each property returned by Get-MgDeviceManagementManagedDevice , including the property EthernetMacAddress, while almost every device has a value in "Ethernet MAC" when I view inspect a device in Intune admin center.
How to reproduce
- execute
$devices = Get-MgDeviceManagementManagedDevice -All - inspect the variable
$devices | Out-GridView - Observe that the column EthernetMacAddress is empty
SDK Version
2.19.0
Latest version known to work for scenario above?
not available
Known Workarounds
No work arounds are known to me
Debug output
Click to expand log
```$devices = Get-MgDeviceManagementManagedDevice -debug -top 20 DEBUG: [CmdletBeginProcessing]: - Get-MgDeviceManagementManagedDevice begin processing with parameterSet 'List'. DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientCertificate', ContextScope: 'Process', AppName: 'Techbeheer Device management App'. DEBUG: [Authentication]: - Scopes: [Device.ReadWrite.All, Group.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, GroupMember.ReadWrite.All]. DEBUG: ============================ HTTP REQUEST ============================
HTTP Method: GET
Absolute Uri: https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=20
Headers: FeatureFlag : 00000043 Cache-Control : no-store, no-cache User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; nl-NL),PowerShell/7.4.3 Accept-Encoding : gzip SdkVersion : graph-powershell/2.19.0 client-request-id : 9c67ecf9-820f-46fd-a605-291431b7a141
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code: OK
Headers: Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : cc53967b-cd96-4a2f-a37c-52f8c0a65843 client-request-id : 9c67ecf9-820f-46fd-a605-291431b7a141 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"008","RoleInstance":"AM2PEPF0001BD29"}} odata-version : 4.0 Date : Mon, 08 Jul 2024 08:15:05 GMT
Body: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices", "@odata.count": 20, "@odata.nextLink": "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$top=20&$skiptoken=LastDeviceName%3d%27DESKTOP-I40MRGL%27%2cLastDeviceId%3d%2768c9d53c-5ea8-4a37-bb42-00f364387f22%27", "value": [ { "id": "68c9d53c-5ea8-4a37-bb42-00f364387f22", "userId": "79a37bfa-5530-4665-a6b0-9a08464a44e3", "deviceName": "DESKTOP-ABCDEFG", "managedDeviceOwnerType": "personal", "enrolledDateTime": "2022-03-30T17:10:30Z", "lastSyncDateTime": "2023-06-21T15:40:09Z", "operatingSystem": "Windows", "complianceState": "noncompliant", "jailBroken": "Unknown", "managementAgent": "mdm", "osVersion": "10.0.22000.1936", "easActivated": true, "easDeviceId": "E1CB75C45E6A2A318036113765B2FB3A", "easActivationDateTime": "0001-01-01T00:00:00Z", "azureADRegistered": true, "deviceEnrollmentType": "windowsAutoEnrollment", "activationLockBypassCode": null, "emailAddress": "[email protected]", "azureADDeviceId": "a0a7d1e5-3199-4086-90e8-5193ec8fb0d4", "deviceRegistrationState": "registered", "deviceCategoryDisplayName": "Unknown", "isSupervised": false, "exchangeLastSuccessfulSyncDateTime": "0001-01-01T00:00:00Z", "exchangeAccessState": "none", "exchangeAccessStateReason": "none", "remoteAssistanceSessionUrl": null, "remoteAssistanceSessionErrorDetails": null, "isEncrypted": false, "userPrincipalName": "[email protected]", "model": "TravelMate Spin B118-G2-R", "manufacturer": "Acer", "imei": "", "complianceGracePeriodExpirationDateTime": "2023-07-22T16:25:27Z", "serialNumber": "", "phoneNumber": "", "androidSecurityPatchLevel": "", "userDisplayName": "xxxxxxxxl", "configurationManagerClientEnabledFeatures": null, "wiFiMacAddress": "84FDD193166F", "deviceHealthAttestationState": null, "subscriberCarrier": "", "meid": "", "totalStorageSpaceInBytes": 127270912000, "freeStorageSpaceInBytes": 62043193344, "managedDeviceName": "xxxxxx_Windows_3/30/2022_5:10 PM", "partnerReportedThreatState": "unknown", "requireUserEnrollmentApproval": null, "managementCertificateExpirationDate": "2024-02-15T11:47:10Z", "iccid": null, "udid": null, "notes": null, "ethernetMacAddress": null, "physicalMemoryInBytes": 0, "enrollmentProfileName": null, "deviceActionResults": [] } ] }
DEBUG: [CmdletEndProcessing]: - Get-MgDeviceManagementManagedDevice end processing.
</details>
### Configuration
```Name Value
---- -----
PSVersion 7.4.3
PSEdition Core
GitCommitId 7.4.3
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Nothing specific to this configuration
Other information
No response
I'm experiencing the same problem, version below.
Get-InstalledModule Microsoft.Graph
Version Name Repository Description
------- ---- ---------- -----------
2.20.0 Microsoft.Graph PSGallery Microsoft Graph PowerShell module
@sikkepitje
If you need an immediate work around, you can do the following:
$devices = Get-MgDeviceManagementManagedDevice -All
foreach ($device in $devices) {
$deviceData = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$($device.id)" -OutputType PSObject
$deviceData | select WiFiMacAddress, EthernetMacAddress
}
It should return the same data you see when using the "Microsoft Intune Admin Center". NOTE: It isn't quick, but it gets the job done.
Any Update on this?