Skip to content

Category (Update-MgDeviceManagementManagedDevice) #1552

@zpfln

Description

@zpfln

Hello,

I am attempting to assign a category to a device through Update-MgDeviceManagementManagedDevice by using the DeviceCategoryDisplayName parameter and using a string but I receive the error below.

Update-MgDeviceManagementManagedDevice -ManagedDeviceId f9e23669-e35f-4a7a-8af8-d104ae88483e -DeviceCategoryDisplayName "Sweden, Stockholm"

Update-MgDeviceManagementManagedDevice : {
  "_version": 3,
  "Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 306f81cd-6ae8-4bb7-b2eb-3b27f476f018 - Url: https://fef.msub06.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices%28%27
f9e23669-e35f-4a7a-8af8-d104ae88483e%27%29?api-version=5022-08-04",
  "CustomApiErrorPhrase": "",
  "RetryAfter": null,
  "ErrorSourceService": "",
  "HttpHeaders": "{}"
}
At line:1 char:1
+ Update-MgDeviceManagementManagedDevice -ManagedDeviceId f9e23669-e35f ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ ManagedDevice...anagedDevice1 }:<>f__AnonymousType1892) [Update-MgDevice...UpdateExpanded1], RestException1
    + FullyQualifiedErrorId : InternalError,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgDeviceManagementManagedDevice_UpdateExpanded1

I have also tried using Update-MgDeviceManagementManagedDevice and the parameter DeviceCategory and a object but I receive another error.

Update-MgDeviceManagementManagedDevice : The annotation 'odata.context' was found. This annotation is either not recognized or not expected at the current position.
At line:1 char:1
+ Update-MgDeviceManagementManagedDevice -ManagedDeviceId f9e23669-e35f ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: ({ ManagedDevice...anagedDevice1 }:<>f__AnonymousType1892) [Update-MgDevice...UpdateExpanded1], RestException1
    + FullyQualifiedErrorId : ModelValidationFailure,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgDeviceManagementManagedDevice_UpdateExpanded1

It might be good to know that I have ran below prior to this.

Connect-MgGraph -Scopes "DeviceManagementManagedDevices.ReadWrite.All","DeviceManagementConfiguration.ReadWrite.All"

Select-MgProfile -Name "beta"

I have also ran the command below successfully as a test, no errors.

Update-MgDeviceManagementManagedDevice -ManagedDeviceId f9e23669-e35f-4a7a-8af8-d104ae88483e -Notes "hello world"

Thoughts?

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