Hi Mike,
As I can see the -Member parameter of Add-ADGroupMember accept objects , but they should be identified
by (let's say) SAM account name. The part of your example "..... Get-ADGroupMember
-Identity 'First Group'
-Recursive)" dreturn the hole objects, not a property values (like SAMaccountName) separated by commas.
I just can't figure it out and asking for an advice. If your example is working on you so maybe there is something wrong on my site :) Sorry if that's the case!!!
I use this one to get a comma-separated list of group members:
(Get-ADGroupMember -Identity "GROUP1" -Recursive | select-object
samaccountname -ExpandProperty samaccountname) -join ","
But when I add this command in a double parenthesis after
Add-ADGroupMember -Identity
'Other Group' -Members
it still doesn't work. Returning an error that It cant find an objects with such identities. It would be great if you can give an advise. One more time if - if your command is working on your side , please excuse me and ignore my post.