Skip to content
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

Set-AutoPilotDeviceAssignedUser still expected to work? #23

Open
MichaelReiserSAP opened this issue Feb 7, 2024 · 3 comments
Open

Set-AutoPilotDeviceAssignedUser still expected to work? #23

MichaelReiserSAP opened this issue Feb 7, 2024 · 3 comments

Comments

@MichaelReiserSAP
Copy link

Hi,
is the Set-AutoPilotDeviceAssignedUser function still expected to work? I'm trying to use in but can't make it work.

Set-AutoPilotDeviceAssignedUser : System.Net.Http.HttpRequestException: 400 Bad Request
{"error":{"code":"BadRequest","message":"{\r\n "_version": 3,\r\n "Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID:
105e0390-e8ee-47cf-86c6-cfb576279131 - Url: https://fef.amsub0202.manage.microsoft.com/DeviceEnrollmentFE/StatelessDeviceEnrollmentFEService/deviceManagement/windowsAutopilotDeviceIdentities('d565e906-babd-494e-baab-85ce1a5583
17')/microsoft.management.services.api.assignUserToDevice?api-version=5023-06-28",\r\n "CustomApiErrorPhrase": "",\r\n "RetryAfter": null,\r\n "ErrorSourceService": "",\r\n "HttpHeaders":
"{}"\r\n}","innerError":{"date":"2024-02-07T07:04:41","request-id":"105e0390-e8ee-47cf-86c6-cfb576279131","client-request-id":"105e0390-e8ee-47cf-86c6-cfb576279131"}}}
At C:\Users\D053249\SAP SE\IES EMEA - Intune\Scripts\AssignUserToDevice\AssignUserToDevice.ps1:204 char:1

  • Set-AutoPilotDeviceAssignedUser -userPrincipalName "xxxxxxxxxx ...
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-AutoPilotDeviceAssignedUser
    
    
@MichaelReiserSAP MichaelReiserSAP changed the title Can't make Set-AutoPilotDeviceAssignedUser working Set-AutoPilotDeviceAssignedUser still expected to work? Feb 7, 2024
@ztrhgf
Copy link

ztrhgf commented Feb 7, 2024

TIP: Working way is to use "https://graph.microsoft.com/$graphApiVersion/$Resource/$id/UpdateDeviceProperties" as I do in my Set-AutopilotDevice function (https://www.powershellgallery.com/packages/IntuneStuff module)

@MichaelReiserSAP
Copy link
Author

TIP: Working way is to use "https://graph.microsoft.com/$graphApiVersion/$Resource/$id/UpdateDeviceProperties" as I do in my Set-AutopilotDevice function (https://www.powershellgallery.com/packages/IntuneStuff module)

I'll check this out today!

@ztrhgf
Copy link

ztrhgf commented Feb 7, 2024

Btw use it like: Set-AutopilotDevice -id <autopilotDeviceId> -userPrincipalName "[email protected]" -addressableUserName "John Doe"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants