Skip to content

Conversation

@svenboll
Copy link

@svenboll svenboll commented Nov 1, 2025

Type

  • Bug Fix
  • New Feature
  • Sample

What is in this Pull Request ?

I used this parameter in a project, and wondered why it didn't work.
I discoverd that the parameter "-RemoveExisting" i.e. in function "Add-Microsoft365GroupMember" (and others) was implemented, but completely out of function.

I want to give this PR into a little discussion, because i don't know if i really covered all scenarios in a good way.

Explanation:
While using Add-AzureADGroupe[Member|Owner] as i can see, the code split the input users into guid-users and none guid-users, and add them separately, so i am clearing the group before the both functions are called.
-> Clearing the Owners is not really possible, because there has to be one Owner left on the given group. So my PR could lead into having 2 owners on the group in the end, instead of the only one i want.

With M365Groups it was a bit easier, there i am using the "Update-[Members|Owners]" functions, which first adds not existing Users to the group and delete users, who should not be member of the group.

It is my first work on this project, and therefor i only want to make small changes and give you the possibility to dicuss. I don't want to really get deeper into huge changes, like combining addmembers and adddirectorymembers into one function (if it is even possible)

Guidance

i was using version 3.1.0 of this module and you can reproduce it with any group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant