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

2.26.0 Set-MgUserManagerByRef Body URL misformed #3150

Closed
jonbartels71 opened this issue Feb 20, 2025 · 2 comments
Closed

2.26.0 Set-MgUserManagerByRef Body URL misformed #3150

jonbartels71 opened this issue Feb 20, 2025 · 2 comments
Assignees
Labels
Bug: PowerShell status:duplicate A duplicate issue type:bug A broken experience

Comments

@jonbartels71
Copy link

Describe the bug

All attempts to execute the Set-MgUserManagerByRef fail with an "Invalid URL format specified in payload." error.

When doing a debug run, the body payload URL has been stripped of all forward slashes:
Body: { "@odata.id": "https:graph.microsoft.comv1.0users4723585c-30e6-3000-7410-5fe10a0081e1" }

Executing the same command with 2.25.0 results in a properly formatted URL:
Body: { "@odata.id": "https://graph.microsoft.com/v1.0/users/4723585c-30e6-3000-7410-5fe10a0081e1" }

Samples with random ObjectIds

Expected behavior

Manager updated without error as long as the parameters and Ids are correct.

How to reproduce

  1. Execute
$mgr = @{"@odata.id"="https://graph.microsoft.com/v1.0/users/4723585c-30e6-3000-7410-5fe10a0081e1"}
Set-MgUserManagerByRef -UserId '40f77e3b-7d6c-33b5-ad32-8b7080acf114' -BodyParameter $mgr -Debug
  1. Watch the error...

SDK Version

2.26.0

Latest version known to work for scenario above?

2.25.0

Known Workarounds

Fall back to 2.25.0

Debug output

Click to expand log ```

DEBUG: [CmdletBeginProcessing]: - Set-MgUserManagerByRef begin processing with parameterSet 'Set'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [Group.ReadWrite.All, openid, Organization.Read.All, profile, User.Read, User.Read.All, User.ReadWrite.All, UserAuthenticationMethod.Read.All, email].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://graph.microsoft.com/v1.0/users/40f77e3b-7d6c-33b5-ad32-8b7080acf114/manager/$ref

Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; en-CA),PowerShell/5.1.26100.2161
SdkVersion : graph-powershell/2.26.0
client-request-id : d99470fd-9c11-4a70-b2c1-1cc9d09440fd

Body:
{
"@odata.id": "https:graph.microsoft.comv1.0users4723585c-30e6-3000-7410-5fe10a0081e1"
}

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 56b9a1ef-d8fc-4977-859a-f997fca894dc
client-request-id : d99470fd-9c11-4a70-b2c1-1cc9d09440fd
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"4","ScaleUnit":"005","RoleInstance":"MWH0EPF0009A7D1"}}
Date : Thu, 20 Feb 2025 22:22:50 GMT

Body:
{
"error": {
"code": "BadRequest",
"message": "Invalid URL format specified in payload.",
"innerError": {
"date": "2025-02-20T22:22:50",
"request-id": "56b9a1ef-d8fc-4977-859a-f997fca894dc",
"client-request-id": "d99470fd-9c11-4a70-b2c1-1cc9d09440fd"
}
}
}

</details>


### Configuration

- OS: Windows 11 Version 24H2 (OS Build 26100.3194)
- .NET 9.0 Installed
- PowerShell 7.5.0

### Other information

_No response_
@jonbartels71 jonbartels71 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 20, 2025
@timayabi2020
Copy link
Contributor

Hi @jonbartels71 apologies for this experience. Kindly use Invoke-MgGraphRequest cmdlet as we work to resolve this issue

@timayabi2020 timayabi2020 self-assigned this Feb 21, 2025
@timayabi2020 timayabi2020 added status:duplicate A duplicate issue and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Feb 21, 2025
@timayabi2020
Copy link
Contributor

Hi @jonbartels71 apologies for the experience. A similar issue had already been reported here #3149 . I'll therefore close this because its a duplicate. Kindly let us track the issue from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: PowerShell status:duplicate A duplicate issue type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants