microsoftgraph / microsoftgraph/msgraph-metadata
managedDeviceCleanupSettings on DeviceManagement entity should be a navigation property instead of a property (Get-MgBetaDeviceManagement - Missing value for DeviceInactivityBeforeRetirementInDays)
Nobody has claimed this yet.
- Dominant language
- XSLT
- Stars
- 166
- Forks
- 55
- Avg merge
- 16h 12m
- Merged PRs (30d)
- 14
Description
Describe the bug
When executing the Get-MgBetaDeviceManagement cmdlet and accessing the ManagedDeviceCleanupSettings object, the value for the inner property DeviceInactivityBeforeRetirementInDays is null. Calling the Graph API with Invoke-MgGraphRequest -Uri https://graph.microsoft.com/beta/deviceManagement/ManagedDeviceCleanupSettings returns the correct value for the property.
To Reproduce
Steps to reproduce the behavior:
- Execute
Get-MgBetaDeviceManagementand filter for theManagedDeviceCleanupSettingsobject:
(Get-MgBetaDeviceManagement).ManagedDeviceCleanupSettings - See the empty value for the
DeviceInactivityBeforeRetirementInDaysproperty.
Expected behavior
It should display the same output as with Invoke-MgGraphRequest.
Debug Output
> (Get-MgBetaDeviceManagement -Debug).ManagedDeviceCleanupSettings
DEBUG: [CmdletBeginProcessing]: - Get-MgBetaDeviceManagement begin processing with parameterSet 'Get'.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): a
DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientSecret', ContextScope: 'Process', AppName: 'graphpowershell'.
DEBUG: [Authentication]: - Scopes: [Directory.Read.All, DeviceManagementServiceConfig.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All,
DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://graph.microsoft.com/beta/deviceManagement
Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22621; de-CH),PowerShell/5.1.22621.2428
Accept-Encoding : gzip
SdkVersion : graph-powershell-beta/2.6.1
client-request-id : 26166a23-6705-4aa9-abf4-26345929a586
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 8d806fc3-3801-4bcf-b9b1-4a91c7e246af
client-request-id : 26166a23-6705-4aa9-abf4-26345929a586
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"004","RoleInstance":"DB1PEPF0001F9D8"}}
OData-Version : 4.0
Date : Tue, 17 Oct 2023 13:05:47 GMT
Body:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement",
"id": "deviceManagement",
"settings": null,
"maximumDepTokens": 100,
"intuneAccountId": "23c03e74-487d-473e-bbde-12141ce45bbb",
"lastReportAggregationDateTime": "0001-01-01T00:00:00Z",
"deviceComplianceReportSummarizationDateTime": "0001-01-01T00:00:00Z",
"legacyPcManangementEnabled": false,
"unlicensedAdminstratorsEnabled": true
}
DEBUG: [CmdletEndProcessing]: - Get-MgBetaDeviceManagement end processing.
DeviceInactivityBeforeRetirementInDays
--------------------------------------
Module Version
> Get-Module Microsoft.Graph.Beta.Devicemanagement
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.6.1 Microsoft.Graph.Beta.DeviceManag... {Get-MgBetaAdminEdge, Get-MgBetaAdminEdgeInternetExplorerM...
Environment Data
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.22621.2428
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2428
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Screenshots
Additional context
Add any other context about the problem here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the DeviceManagement metadata for managedDeviceCleanupSettings with the Graph endpoint shown in the report: https://graph.microsoft.com/beta/deviceManagement/ManagedDeviceCleanupSettings. Confirm that DeviceInactivityBeforeRetirementInDays is exposed through the generated navigation relationship, then verify that Get-MgBetaDeviceManagement matches Invoke-MgGraphRequest.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100