Skip to content

Command fails with: property 'AdditionalProperties' does not exist on type 'microsoft.management..' #2355

@msewaweru

Description

@msewaweru

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

Describe the bug
i'm working on this script to export policies from one Microsoft tenant and re create them in another tenant.
the script is as follows:
$compliancePolicies = Get-MgDeviceManagementDeviceCompliancePolicy
$configurationProfiles = Get-MgBetaDeviceManagementDeviceConfiguration

$exportcompliancePolicies = $compliancePolicies | Export-Clixml -Path $compliancePoliciesPath
$exportconfigurationProfiles = $configurationProfiles | Export-Clixml -Path $configurationProfilesPath
Disconnect-MgGraph

$importcompliancePolicies = Import-Clixml -Path $compliancePoliciesPath
$importconfigurationProfiles = Import-Clixml -Path $configurationProfilesPath

Connect-MgGraph -Scopes DeviceManagementConfiguration.ReadWrite.All

$importcompliancePolicies | New-MgDeviceManagementDeviceCompliancePolicy

the last command fails with this error:

New-MgDeviceManagementDeviceCompliancePolicy : The property 'AdditionalProperties' does not exist on type 'microsoft.management.services.api.deviceComplianceDeviceOverview'. Make sure to only use property names that are defined by the type. Status: 400 (BadRequest) ErrorCode: ModelValidationFailure

which is a bit puzzeling since your documentation has [-AdditionalProperties ] as the first option for the command.

if i check the "AdditionalProperties" for type, i get this:
$importcompliancePolicies[0].AdditionalProperties.GetType()

IsPublic IsSerial Name BaseType
True True Hashtable System.Object

which seems to be in lien with what the documentation is asking for.

let me know what other information i can provide.
I've tried the beta version of graph and it fails with the exact error.
it also fails creating the configuration profiles (New-MgBetaDeviceManagementDeviceConfiguration)

To Reproduce
Steps to reproduce the behavior:

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

Expected behavior

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

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.

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.

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.

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions