Script to give permissions to shared mailbox fails.

Occasional Contributor
I want to use the below link to set permissions for shared mailbox.
However I am getting error “no matching security principals found”

My colleague can run this. I am new and have limited permission. Please suggest the permission that I need for running this script.
2 Replies
best response confirmed by EXCH_Enthusiast (Occasional Contributor)
Said error is thrown when the script cannot match the value(s) you provide for the -User parameter against the known security principals in your tenant. For that, it uses the Get-SecurityPrincipal cmdlet, which by default is only available to those assigned the "Role Management" role. Ask your admin to assign you said role, or update the script to use the Get-Recipient cmdlet instead.
Amazing Vasil