microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Endpoint "/beta/deviceManagement/configurationPolicies" misbehaves when expanding property assignments for specific policy

Open
#3,337 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Service issue type:bug
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

This issue happens ONLY when the targeted policy is of a templateFamily that starts with "endpointSecurity".

I was trying to query the endpoint using the cmdlet:
Get-MgBetaDeviceManagementConfigurationPolicy -ExpandProperty assignments -DeviceManagementConfigurationPolicyId "PolicyID"
and, although the response had the property assignments in the body json, the assignments where empty.

Interestingly, if I query the endpoint without specifying a policy ID (Get-MgBetaDeviceManagementConfigurationPolicy -ExpandProperty assignments), it seems to actually return the data correctly for all the policies.

For the record, I replicated the same scenario in the graph explorer as well

Expected behavior

Expected behaviour would be to actually be able to expand the property assignments even when using the id to target a specific policy

How to reproduce

Execute the command Get-MgBetaDeviceManagementConfigurationPolicy -ExpandProperty assignments
Check that all the policies return the correct assignment data
Execute the command Get-MgBetaDeviceManagementConfigurationPolicy -ExpandProperty assignments -DeviceManagementConfigurationPolicyId "PolicyID"
Check that the returned data do not show any assignments.

Non Working query
Image

Working query
Image

SDK Version

2.28.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
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

### Other information

Since this issue is tied to the endpoint not returning the correct data, I believe it is not tied to any of the SDKs. Should be a bug on the backend side,

Contributor guide

Open the contributing guide

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 reproducing the two Get-MgBetaDeviceManagementConfigurationPolicy queries against /beta/deviceManagement/configurationPolicies, using -ExpandProperty assignments with and without -DeviceManagementConfigurationPolicyId. Compare the assignment data for a policy whose templateFamily starts with "endpointSecurity"; done means the targeted query returns the same assignments as the unfiltered query.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.