microsoftgraph / microsoftgraph/msgraph-metadata

managedDeviceCleanupSettings on DeviceManagement entity should be a navigation property instead of a property (Get-MgBetaDeviceManagement - Missing value for DeviceInactivityBeforeRetirementInDays)

Open
#464 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ToTriage
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:

  1. Execute Get-MgBetaDeviceManagement and filter for the ManagedDeviceCleanupSettings object:
    (Get-MgBetaDeviceManagement).ManagedDeviceCleanupSettings
  2. See the empty value for the DeviceInactivityBeforeRetirementInDays property.

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
image

Additional context

Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.