Skip to content

Get-MgUserMemberGroup Unable to cast object of type #929

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

Closed
Joris-automation opened this issue Nov 2, 2021 · 2 comments
Closed

Get-MgUserMemberGroup Unable to cast object of type #929

Joris-automation opened this issue Nov 2, 2021 · 2 comments

Comments

@Joris-automation
Copy link

Trying use the get-mgUserMemberGroup cmdlet results in an cast error :

afbeelding

Use this command to reproduce the bug Get-MgUserMemberGroup -SecurityEnabledOnly -UserId <userobjectid>

Similar bug is reported in this thread : #610 But this is regarding a different cmdlet

Spoke to Microsoft support and they offered me a work around for now :

$body = @'
{
"securityEnabledOnly":false
}
'@

$response = Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/users/<userobjectid>/microsoft.graph.getMemberGroups" -Body $body

This work around is working for me!

@ghost ghost added the ToTriage label Nov 2, 2021
@peombwa
Copy link
Member

peombwa commented Nov 3, 2021

Thanks for bringing this to our attention. This is an issue with how OData action and function responses are defined in the OpenAPI document that this SDK is generated from. We are already tracking this here #610, and a fix will be provided by microsoftgraph/microsoft-graph-devx-api#307.

@peombwa
Copy link
Member

peombwa commented Nov 3, 2021

Closing as duplicate of #610

@peombwa peombwa closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants