-
Notifications
You must be signed in to change notification settings - Fork 214
Description
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
- Make sure you can reproduce this issue using the latest released version of Microsoft.Graph or Microsoft.Graph.Beta.
- Please search the existing issues to see if there has been a similar issue filed.
- For issues related to authentication and service errors, please refer to our troubleshooting guide. For service issues, please open a question at https://developer.microsoft.com/graph/support.
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:
- Execute
-Mg-with... - See error at
...
Expected behavior
A clear and concise description of what you expected to happen.
Debug Output
Run the problematic command with
-Debugand 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 runGet-Module -ListAvailableand paste the output.
Environment Data
Please run
$PSVersionTableand 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.