Forum Discussion

DavidM2202's avatar
DavidM2202
Copper Contributor
Apr 10, 2024

Manage security groups with MS Graph

Hi everyone,

I'm facing an issue related to managing EntraID groups via powershell using MS Graph. Specifically I want to use the CMDLET Remove-MgGroupOwnerByRef. According to MS Help (https://learn.microsoft.com/powershell/module/microsoft.graph.groups/remove-mggroupownerbyref) the syntax of this would be Remove-MgGroupOwnerByRef -GroupId $groupId -DirectoryObjectId $directoryObjectId. But for me it seems, that the parameter -DirectoryObjectId is not recognized by the CMDLET. I am receiving an error, when trying to execute with some example values:

 

+ CategoryInfo : InvalidArgument: (:) [Remove-MgGroupOwnerByRef], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Remove-MgGroupOwnerByRef

 

Is this a known bug or does anybody have an idea?

 

Thanks

Resources