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

New-MgGroupMember cmdlet broken in 2.26.0 #3156

Closed
lucien1264 opened this issue Feb 21, 2025 · 1 comment
Closed

New-MgGroupMember cmdlet broken in 2.26.0 #3156

lucien1264 opened this issue Feb 21, 2025 · 1 comment
Labels
status:duplicate A duplicate issue status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@lucien1264
Copy link

Describe the bug

Using PowerShell 7.5 and Graph modules version 2.26.0
The New-MgGroupMember cmdlet returns a " New-MgGroupMember_CreateExpanded: Invalid URL format specified in payload " error.
Is the cmdlet no longer supported?

$upn = '[email protected]'
$user = Get-MgUser -UserId $upn | Select-Object Id

tried with and without quotes:

New-MgGroupMember -GroupId '2d4f9439-1680-425e-a185-1403687ff2fc' -DirectoryObjectId $user.Id
New-MgGroupMember_CreateExpanded: Invalid URL format specified in payload.

New-MgGroupMember -GroupId "2d4f9439-1680-425e-a185-1403687ff2fc" -DirectoryObjectId $user.Id
New-MgGroupMember_CreateExpanded: Invalid URL format specified in payload.

New-MgGroupMember -GroupId 2d4f9439-1680-425e-a185-1403687ff2fc -DirectoryObjectId $user.Id
New-MgGroupMember_CreateExpanded: Invalid URL format specified in payload.

Expected behavior

No Error, and user added to the Security group.

How to reproduce

Connect-Graph -Scopes "User.Read.All","Group.ReadWrite.All"

$upn = '[email protected]'
$user = Get-MgUser -UserId $upn | Select-Object Id

New-MgGroupMember -GroupId '2d4f9439-1680-425e-a185-1403687ff2fc' -DirectoryObjectId $user.Id

SDK Version

2.26.0

Latest version known to work for scenario above?

2.25.0

Known Workarounds

re-write scripts to use New-MgGroupMemberByRef which would mean a nice additional workload.

Debug output

Click to expand log ```

New-MgGroupMember -GroupId "2d4f9439-1680-425e-a185-1403687ff2fc" -DirectoryObjectId $user.Id -Debug
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:

Confirm
Are you sure you want to perform this action?
Performing the operation "New-MgGroupMember_CreateExpanded" on target "Call remote
'CreateGroupMember' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
DEBUG: CmdletProcessRecordAsyncStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: /groups/2d4f9439-1680-425e-a185-1403687ff2fc/members/$ref
DEBUG: RequestCreated: /v1.0/groups/2d4f9439-1680-425e-a185-1403687ff2fc/members/$ref
DEBUG: HeaderParametersAdded:
DEBUG: BodyContentSet:
DEBUG: BeforeCall:
DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
New-MgGroupMember_CreateExpanded: Invalid URL format specified in payload.
DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: CmdletEndProcessing:

</details>


### Configuration

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

### Other information

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

Hi @lucien1264 apologies for this experience. The issue was already reported here #3154. I'll therefore close this and advise that we track the issue from there

@timayabi2020 timayabi2020 added the status:duplicate A duplicate issue label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:duplicate A duplicate issue status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants