Update-MgUser throws HTTP response object instead of updating User

Nick Borg 20 Reputation points
2024-02-20T07:49:35.04+00:00

Hello, I'm trying to update the Password Policies with Application permissions. The Code i'm using looks like this:

Connect-MgGraph -ClientId $ClientID -TenantId $TenantID -CertificateThumbprint $CertificateThumbprint Update-MgUser -UserId $User -PasswordPolicies "DisablePasswordExpiration" Disconnect-MgGraph

the answer powershell returns looks like this:User's image

I think it's a HTTP Answer but i don't really know how to read it or what to do with it. Thank you in advance Nick

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,264 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 115.3K Reputation points MVP
    2024-02-20T08:02:25.77+00:00

    Those are the headers of the response, not sure why they are returned. Are you running this in Windows PowerShell? Try using PowerShell 7+ instead and make sure the module has been updated to the latest version. With those, you should see no response at all on "success" execution of the cmdlet (the response is an "200 OK" with empty body).

    For any Graph cmdlet, you can try running it with -Verbose -Debug to see the actual request/response. I guess we can safely assume that the above executed OK, given the lack of error messages. But I'd still recommend the latest module/PS 7.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.