This project has moved and is read-only. For the latest updates, please go here.


Remove from Group Membership not working


I have used the working with multivalued attributes to add users to Groups. But when I do Remove it does not work.

$obj = Get-Resource -ObjectType Group -AttributeName ObjectID -AttributeValue $object
Save-Resource $obj

If I do

I add a member successfully. Is the remove format different? Or a code issue?

Closed Jan 11, 2016 at 9:17 PM by ryannewington


ryannewington wrote Oct 3, 2015 at 4:04 AM


Thanks for the report. That certainly doesn't seem right.

Can you check if getting the object with the following command

$obj = Get-Resource -ObjectType Group -AttributeName ObjectID -AttributeValue $object -AttributesToGet @("ExplicitMember")

works when you call the Remove method on ExplicitMember?

myFIMcodeplex wrote Oct 3, 2015 at 10:32 AM


I just tried that and it made no difference the Remove still did not work.


ryannewington wrote Oct 3, 2015 at 10:04 PM

Found the issue. The underlying array was looking to remove an objectID, rather than the object. ($attributeValue.ObjectID would have worked.)

Build 5755 has been fixed to allow the use of the object itself, as well as the object ID, when removing an attribute value from a multi-valued reference attribute.

myFIMcodeplex wrote Oct 3, 2015 at 11:55 PM

Hi Ryan
What is different here is that one has to get the resource first before doing the remove.

If you do a Write-host $obj.ExplicitMember you will see the ObjectID but you cannot do a

you have to get the resource first so it will be
$obj2=Get-Resource -ObjectType Person -AttributeName ObjectID -AttributeValue 8158c61c-b88d-4271-9cd2-864348fd35a1

Then do either one of these

But for the Add member to Group you can simply do this
And that works

Why is the Add and remove behavior different? Would be nice if one can remove with just the ObjectID value instead of another extra step of getting the resource first. The Import-FImConfig did remove with just the ObjectID value.


ryannewington wrote Oct 4, 2015 at 12:42 AM

So the reason is that there is an ArrayList 'proxy' object that holds the changes before submitting them back to the 'real' object. The ArrayList takes a type of 'object' (so - anything) and the backend object knows how to convert any known type to the right value for references when it gets it.

However, 'remove' is a function of the array list itself. It doesn't get to the backend object for processing. It's looking for an exact object type match. I've added support in for GUID in the release you are using. You should be able to do this as a workaround for now.
or remove it by its index

I agree its not ideal, I'll re-open the issue, and i'll look to improvise better support for this. Add and Remove should behave the same.

ryannewington wrote Oct 8, 2015 at 11:38 PM

Added support for string, GUID, RMObject, and UniqueIdentifier values in the Remove() function as of version 1.0.5760

myFIMcodeplex wrote Oct 9, 2015 at 12:29 AM

Thanks Ryan! Tested it and it works well


removes user from Group