Unable to manage microsoft 365 groups using PowerShell cmdlet

asked 2021-04-16T15:02:10.417+00:00
Baptiste BERTRAND-RAPELLO 1 Reputation point


I would like to create, delete and add member in a Micorosft 365 group using powershell. The commands I used are : New-UnifiedGroup, Add-UnifiedGroupLinks, and Remove-UnifiedGroup .

So I have created a first script that connect using the login (e-mail) and pasword and passing the option '-Credential' to the cdmlets : Connect-ExchangeOnline and Connect-AzureAD. And in this case, I managed to do everything I want.

However, I have created a second script where we use certificate to connect to the Administrative server.
I have followed these documentation :

I manage to connect to the server using certificates, so I connect using ' Connect-ExchangeOnline -AppId $appID -CertificateThumbprint $thumbPrint -CertificatePassword $securePasswd -Organization $organisation' and ' Connect-AzureAD -TenantId $tenantID -ApplicationId $appID -CertificateThumbprint $thumb'

And in this case, any of these three commands I want to use (New-UnifiedGroup, Add-UnifiedGroupLinks, and Remove-UnifiedGroup) are NOT working ... And I get this kind of error :


And if I want to create a unified group

And if I want to remove an existing "microsoft 365" group


And all the other commands I use in my script like : Set-AzureADUserLicense, Add-DistributionGroupMember, New-Mailbox, Add-MailboxPermission, Add-RecipientPermission works nice and perfectly.

So why do I get these kind of errors ? Did you had the same problem and may you have a solutions for it ?

I need to use certificate instead of a classical login and password, it is very usefull and mandatory for my script.

Thank you for your answers

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,549 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,609 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. answered 2021-04-16T17:19:32.993+00:00
    Vasil Michev 61,366 Reputation points Microsoft MVP

    There are some known issues around using the Unified group cmdlets with CBA, Microsoft is working on addressing them.

  2. answered 2022-08-15T16:48:58.19+00:00
    Arant, Kenneth 1 Reputation point

    Any update on this issue?

    No comments