PowerShell Script that updates Distribution Groups - JSON error

Patterson, Cody L 0 Reputation points
2023-02-27T16:35:38.5566667+00:00

I have a PowerShell script that updates AAD distribution groups. Periodically, I will get a JSON error when doing the update

Here is the PowerShell command that I'm using. I have checked the IDs that are getting posted and none of them seem to have any incorrect characters in them.

Update-DistributionGroupMember -Identity $dgalias -Members $UserList -Confirm:$false -ErrorAction Stop    

I have attached the error as an image as it would not let me paste it in the text field.

User's image

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,683 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,766 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 67,366 Reputation points MVP
    2023-02-27T16:41:15.88+00:00

    Are you getting the same type of errors when connecting via the old, RPS-based method (i.e. Connect-ExchangeOnline -UseRPSSession). If not, best report this directly to the team at RPSdeprecation at service.microsoft.com.