-
Notifications
You must be signed in to change notification settings - Fork 192
New-MgGroupMember fails with Invalid URL format #3154
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
Comments
@12Knocksinna apologies for the experience. We are working to resolve this issue. |
The problem here is that the same issue might exist for other cmdlets... |
Yes, we have identified the issue, and PR has already been merged. |
When you plan to update the PS gallery? |
Were any other cmdlets found with the same problem? In other words, is the only update required for the Microsoft.Graoh.Groups module? |
Hopefully you can fix the Azure Automation issue reported in #3151 at the same time. The SDK shouldn't break stuff like this with a new version. |
We have registered devices in Intune using Get-WindowsAutoPilotInfo.ps1 and are experiencing the same issue. Are there any updates on a resolution or possible workaround? |
I was changing the code using direct a Graph API:
"@ Or you can switch to this commandlet: |
@Dankil90, have you tried reverting to V2.25 of the SDK |
I've just tried running New-MGGroupMember after reverting to 2.25.0, and it's still giving this "resource does not exist or one of its queried reference-property objects are not present" error when using syntax from a script I've had running without issue for months, the script only recently started having issues after upgrading my version of the Graph SDK on my device. |
@diabeetus01 I just ran New-MgGroupMember on my PC with V2.25 and it worked perfectly. I suspect that some vestiges of V2.26 are lingering. To remove V2.26, I uninstalled the module, removed all traces of module files from the PC, and rebooted. I then reinstalled V2.25. All went well thereafter. |
Interesting, I just went through those steps and after reboot its still giving the same failures, tested with a few devices and with PS7 as well, wouldn't be shocked if its an issue on device still but version installed reports 2.25.0. Will keep poking around to see what I can figure out, as it seems New-MgGroupMember was the only way to add a Device ID to a Group, since I haven't found a working odata.id string yet to pass the device ID to that works with New-MgGroupMemberByRef. |
Adding onto this to say I am experiencing the same behavior with 2.26.0 with scripts working previously. Reverting did help but caused issues with other scripts that only seemed to work on 2.26.0 |
Same issue here. Getting invalid URL format in payload when attempting to add a device to an AAD group. |
Want to share that I noticed this issue with the V2.26 of Microsoft.Graph.Identity.Governance particularly when calling New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest_Create:
Line |
22 | New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -BodyP …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The resource '' is invalid.
Status: 400 (BadRequest)
ErrorCode: DirectoryScopeId
Date: 2025-02-25T15:04:29
Headers:
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : bba84732-ee33-487d-bef0-f65dd7063c99
client-request-id : d4525c46-1b3f-458b-94ba-d4c7b779beaa
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Canada East","Slice":"E","Ring":"3","ScaleUnit":"000","RoleInstance":"QB1PEPF00005798"}}
Date : Tue, 25 Feb 2025 15:04:28 GMT Meanwhile (I've supplied a "/" (slash), not "" (blank/null/empty): [PS] > $params.DirectoryScopeId
/ The only reason why I think this is the same issue is that @timayabi2020 closed #3173 and referenced this issue. |
When going back to V2.25, it's really important to expunge all traces of V2.26 from a PC. Delete all the files, empty the wastebasket, etc. Reboot to ensure that no open files block deletion. Delete again if necessary. Get back to bare metal and then install V2.25... that's what I did and everything runs just fine since. |
I'm also using the Get-WindowsAutopilotInfo script. I tried to force the install of the modules with -RequiredVersion 2.25.0 but it appears that the WindowsAutopilotIntune module is installing version 2.26.0 during installation. I don't have a workaround at this time, but will continue to work on it and if I find something, I'll post it here. |
Hi all please upgrade to version 2.26.1 and let us know if you are still experiencing the same challenge of |
@timayabi2020 , at least for New-MgGroupmember the issue is solved. I didn't yet test anything else. Is it correct that Microsoft.Graph.DeviceManagement.Actions is on 2.25.0 ? |
It's working for me now. At least using the WindowsAutopilotIntune module with the Get-WindowsAutopilotInfo script |
With the new module release (2.26.1), the process should work again. |
It was working 2 hours ago. I'm not sure if its now broken again. |
Nice job getting this one out so quick @timayabi2020 - solved my issue with Microsoft.Graph.Identity.Governance ! Thanks very much. |
It's now working with 2.26.1 But that should affects all versions below 2.26.1? I've tested with 2.26.0 and 2.25.0 |
For me it's still not working, for us it's breaking when creating a new Teams and passing an owner, it's still working well by using V2.25.0. Should that be fixed with V2.26.1?
|
Describe the bug
After updating the SDK to V2.26, the New-MgGroupMember cmdlet fails with an "Invalid format specified in payload" error. It seems like there's an unresolved reference for the new group member ($ref) at the end of the URL generated for the request.
Expected behavior
I expect New-MgGroupMember to work!
How to reproduce
New-MgGroupMember -GroupId $GroupId -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/ad5b9740-0925-4254-8393-e47072fc5696/members/$ref
DEBUG: RequestCreated: /v1.0/groups/ad5b9740-0925-4254-8393-e47072fc5696/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:
SDK Version
V2.26
Latest version known to work for scenario above?
V2.25
Known Workarounds
Use a Graph request
Debug output
See above
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
The issue has been validated by several others.
The text was updated successfully, but these errors were encountered: