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

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.
5,396 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,777 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 96,436 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.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more