Skip to content

Get-MgBetaDeviceManagementConfigurationPolicySetting does not give full data #2663

@jc3z06

Description

@jc3z06

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

Describe the bug

A clear and concise description of what the bug is.

When I the command:
Get-MgBetaDeviceManagementConfigurationPolicySetting -DeviceManagementConfigurationPolicyId | convertto-json -depth 100

The JSON data that is returned is incomplete. For example, this is returned in my tenant when I run that command:
[
{
"Id": "0",
"SettingDefinitions": null,
"SettingInstance": {
"SettingDefinitionId": "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow",
"SettingInstanceTemplateReference": {
"SettingInstanceTemplateId": null
}
},
"AdditionalProperties": {

                             }
}

]

When enabling Debug, I can see all the data, the command just doesnt capture it all. Please see below for debug info.

To Reproduce
Steps to reproduce the behavior:

  1. Execute -Mg- with ...
  2. See error at ...

Run the following command in your tenant with the appropriate configurationsetting ID:
Get-MgBetaDeviceManagementConfigurationPolicySetting -DeviceManagementConfigurationPolicyId | convertto-json -depth 100

Expected behavior

A clear and concise description of what you expected to happen.

What data is expected should be as follows when I directly query the graph API:

[
{
"settingInstance": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance",
"settingDefinitionId": "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow",
"settingInstanceTemplateReference": null,
"choiceSettingValue": {
"children": [

                                                                                  ],
                                                                     "settingValueTemplateReference":  null,
                                                                     "value":  "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow_0"
                                                                 }
                                      },
                  "id":  "0"
              }

]
Debug Output

Run the problematic command with -Debug and paste the resulting debug stream below.
⚠ ATTENTION: Be sure to remove any sensitive information that may be in the logs.

DEBUG: [CmdletBeginProcessing]: - Get-MgBetaDeviceManagementConfigurationPolicySetting begin processing with parameterSet 'List'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [DeviceManagementApps.ReadWrite.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementManagedDevices.ReadWrite.All, Domain.Read.All, email, openid, profile, User.Read, User.Read.All,
User.ReadWrite.All, UserAuthenticationMethod.Read.All, UserAuthenticationMethod.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/beta/deviceManagement/configurationPolicies/39fd952d-a608-4e11-a6a4-96322ac95ac6/settings

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-US),PowerShell/5.1.22621.2506
Accept-Encoding : gzip
SdkVersion : graph-powershell-beta/2.15.0
client-request-id : 88afedd5-a06f-43a7-8ad0-d5a77a75b129

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : eed2b179-cac2-40b3-9341-7a83f108b1ef
client-request-id : 88afedd5-a06f-43a7-8ad0-d5a77a75b129
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"BL02EPF0000D1A8"}}
OData-Version : 4.0
Date : Fri, 05 Apr 2024 20:18:35 GMT

Body:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/configurationPolicies('39fd952d-a608-4e11-a6a4-96322ac95ac6')/settings",
"value": [
{
"id": "0",
"settingInstance": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance",
"settingDefinitionId": "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow",
"settingInstanceTemplateReference": null,
"choiceSettingValue": {
"settingValueTemplateReference": null,
"value": "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow_0",
"children": []
}
}
}
]
DEBUG: [CmdletEndProcessing]: - Get-MgBetaDeviceManagementConfigurationPolicySetting end processing.
[
{
"Id": "0",
"SettingDefinitions": null,
"SettingInstance": {
"SettingDefinitionId": "device_vendor_msft_policy_config_devicelock_preventlockscreenslideshow",
"SettingInstanceTemplateReference": {
"SettingInstanceTemplateId": null
}
},
"AdditionalProperties": {

                             }
}

Module Version

Please run Get-Module Microsoft.Graph* after cmdlet execution and paste the output below.
If a module cannot be installed or imported, please run Get-Module -ListAvailable and paste the output.

PS C:\powershell> Get-Module Microsoft.Graph*

ModuleType Version Name ExportedCommands


Script 2.15.0 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext...}
Script 2.16.0 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext...}
Script 2.15.0 Microsoft.Graph.Beta.DeviceManag... {Get-MgBetaAdminEdge, Get-MgBetaAdminEdgeInternetExplorerMode, Get-MgBetaAdminEdgeInternetExplorerModeSiteList, Get-MgBetaAdminEdgeInternetExplorerModeSiteListCount...}
Script 2.16.0 Microsoft.Graph.Beta.DeviceManag... {Get-MgBetaAdminEdge, Get-MgBetaAdminEdgeInternetExplorerMode, Get-MgBetaAdminEdgeInternetExplorerModeSiteList, Get-MgBetaAdminEdgeInternetExplorerModeSiteListCount...}

Environment Data

Please run $PSVersionTable and paste the output below. If running the Docker container image, indicate the tag of the image used and the version of Docker engine.

PS C:\powershell> $PSVersionTable

Name Value


PSVersion 5.1.22621.2506
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.2506
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions