-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update-MgDeviceManagementManagedDevice does not allow you to update primary user #2988
Comments
Hi @aklinden thank you for identifying and reporting this issue. I am not able to pinpoint any fault associated with the SDK because based on your debug information, it is packaging the attributes as per the documentation here. There is also no error/exception thrown by both the SDK and the service. I therefore advise that you raise an issue here https://developer.microsoft.com/en-us/graph/support so that the API owner can respond to it. |
Sorry for the late reply. Thanks for taking a look! Just for clarity, in the documentation you linked, all of the user related attributes say read only in the description. If that were to change to an editable property, that would fall on the API owner, correct? |
Looking more closely, there are only two properties that don't have read-only in the description... |
@aklinden yes the service owner should be able to provide more clarity on why some properties are updateable and others not. Kindly open a support ticket here https://developer.microsoft.com/en-us/graph/support. |
Describe the bug
Trying to create an automation that sets the primary user property to reflect the user that's been assigned the device. But it doesn't seem like
Update-MgDeviceManagement
even works.-ManagedDeviceid
works just fine, but neither-Users
or-BodyParameters
seem to work properly.Expected behavior
Based on the description, it seems like it should update the device object in Intune.
How to reproduce
With
-Bodyparamater
With
-Users
DEBUG: [CmdletBeginProcessing]: - Update-MgDeviceManagementManagedDevice begin processing with parameterSet 'Update'.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientCertificate', ContextScope: 'Process',
AppName: 'Company_App_Name'.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: [Authentication]: - Scopes: [Device.ReadWrite.All, User.ReadWrite.All, UserAuthenticationMethod.ReadWrite.All,
Directory.ReadWrite.All, DeviceManagementServiceConfig.ReadWrite.All, Organization.ReadWrite.All,
DeviceManagementManagedDevices.ReadWrite.All, GroupMember.ReadWrite.All, AuditLog.Read.All,
DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All].
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
Confirm
Are you sure you want to perform this action?
Performing the operation "Update-MgDeviceManagementManagedDevice_Update" on target "Call remote 'PATCH
/deviceManagement/managedDevices/{managedDevice-id}' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
PATCH
Absolute Uri:
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{mymanagedDevice-id}
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.4111
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.19.0
client-request-id : df064533-b8ca-43d5-a3bc-2f16f03d162b
Body:
{
"UserEmail": "[email protected]"
}
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
NoContent
Headers:
Strict-Transport-Security : max-age=31536000
request-id : b8271a37-ad0e-46ed-8edf-45751ea28a14
client-request-id : df064533-b8ca-43d5-a3bc-2f16f03d162b
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US
2","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"MW2PEPF000031CA"}}
Date : Fri, 04 Oct 2024 22:17:49 GMT
Body:
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: [CmdletEndProcessing]: - Update-MgDeviceManagementManagedDevice end processing.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
The text was updated successfully, but these errors were encountered: