Skip to content

Missing cmdlet Remove-MgGroupMember #3121

@AstroFish849

Description

@AstroFish849

Describe the bug

When trying to remove a user from an M365 group the 'Remove-MgGroupMember' is not recognized as a cmdlet.

Looking through here I can't see it listed either:
https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/samples/4-UsersAndGroups.ps1

Expected behavior

User is removed from the M365 group

How to reproduce

Execute: Remove-MgGroupMember -GroupId $groupId -DirectoryObjectId $userId
Error: The term 'Remove-MgGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable program.

SDK Version

2.25.0

Latest version known to work for scenario above?

No response

Known Workarounds

None yet

Debug output

Remove-MgGroupMember : The term 'Remove-MgGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:31 char:9

  •     Remove-MgGroupMember -GroupId $groupId -DirectoryObjectId $us ...
    
  •     ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Remove-MgGroupMember:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Configuration

Name Value


PSVersion 5.1.17763.6766
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.6766
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions