nathancrjackson / ps-o365-group-sync

PowerShell Office 365 Group Sync Utility
GNU General Public License v3.0
0 stars 0 forks source link

Issues attempting to make group owners a group member #1

Open nathancrjackson opened 5 years ago

nathancrjackson commented 5 years ago

When attempting to make a group owner a group member the following error occurs:

Add-AzureADGroupMember : Error occurred while executing AddGroupMember
Code: Request_BadRequest
Message: One or more added object references already exist for the following modified properties: 'members'.
RequestId: _____________________________________________
DateTimeStamp: Thu, 10 Oct 2019 02:00:32 GMT
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At C:\Office365 Group Sync\Office365 Group Sync.ps1:685 char:5
+ ...             Add-AzureADGroupMember -ObjectId $Script:GroupDetails[$Ch ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-AzureADGroupMember], ApiException
    + FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.AddGrou
   pMember

The user can be added manually in the Office 365 portal. This might be an issue with the Azure AD PowerShell not being able to handle this correctly.

nathancrjackson commented 5 years ago

After running the script in Debug mode it looks like it's a comparison issue. When comparing memberships I found

        Comparing Group
                        ? Remove User@contoso.com
                        ? Add user@contoso.com

Unsure why Pending Memberships didn't also contain ? Remove User@contoso.com