Author Posts

May 26, 2016 at 10:49 pm

Trying to remove a MSO groupmember for which it seems the cmdlet requires a GroupObjectId parameter however, the get-msolUser doesn't have it available from what I can tell.

 Remove-MsolGroupMember -GroupObjectId ecc923f7-480f-4b61-b0d1-05ddbadf0388 -GroupMemberType User -GroupMemberObjectId
Remove-MsolGroupMember : Missing an argument for parameter 'GroupMemberObjectId'. Specify a parameter of type 'System.Nullable`1[System.Guid]' and try
again.

get-help -example also fail

May 27, 2016 at 12:19 pm

You are missing an argument for the parameter -GroupMemberObjectId

-GroupMemberObjectId 123456789

May 27, 2016 at 6:48 pm

I was looking initially for a -properties * parameter like found in Get-ADUser but this exposed the objectID that I wasn't aware of

Get-MsolUser -UserPrincipalName foof@company.com | fl objectid 
ObjectId : 7f916f55-6690-4b1c-965b-ca7886dbc9bs 

However, I still get an error from this code:

 Remove-MsolGroupMember -GroupObjectId ecc923f7-480f-4b61-b0d1-05ddbadf0384 -GroupMemberType User -GroupMem
berObjectId 7f916f55-6690-4b1c-965b-ca7886dbc9bs
Remove-MsolGroupMember : Unable to update parameter. Parameter name: . 

June 2, 2016 at 11:52 am

get-help Remove-MsolGroupMember -Examples

————————– EXAMPLE 1 ————————–

C:\PS>$groupId = Get-MsolGroup -searchString MyGroup
$userid = get-msoluser -userPrincipalName user@contoso.com
Remove-MsoLGroupMember -groupObjectId $groupid -GroupMemberType User -groupmemberobjectid $userid

June 3, 2016 at 7:43 pm

Hi Dan, Yes I tried that earlier before posting. I get this error

 Remove-MsolGroupMember : Cannot bind parameter 'GroupObjectId'. Cannot convert the
"Microsoft.Online.Administration.Group" value of type "Microsoft.Online.Administration.Group" to type
"System.Guid".