Run the following to get a list of the current script execution policies, so you can refer back to it as needed...
Copied to clipboard!
Get-ExecutionPolicy -List
Next use the code below to set the Execution Policy with the Process scope so it only affects the current PowerShell session. The execution policy is saved in the environment variable $env:PSExecutionPolicyPreference and is deleted when the session is closed. Answer “Y” to allow the change...
Copied to clipboard!
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
Now we'll install the updated version of PowerShell that supports MFA/REST (answer YES when installing)...
NOTE: You'll need the most recent Powershell update that supports MFA / REST. Connect to Exchange Online using a global administrator account (Don't forget to replace 'you@you-firm' with your global admin account)
By default, Microsoft Modern Authentication is used to sign in. Specify your Microsoft 365 tenant admin credentials. If you have MFA (Multi-Factor Authentication) enabled for your Azure account, you must confirm your account login with your second factor.
Getting calendar permissions...
NOTE: Don't forget to replace 'you@yourfirm.com' with the user's email address. You can view current calendar (folder-level) permissions of the specified mailbox by using the Get-MailboxFolderPermission cmdlet (this cmdlet is available in the cloud-based service and in on-premises Exchange):
Using PowerShell, you can find all the calendars in your organization/tenant that a particular user has been granted access to. In this example we want to display a list of user mailboxes, calendars to which the user named Mueller has access:
The list of users whose calendars the user can access are listed in the Identity column. The AccessRights field specifies the current calendar permissions.
Now run the following code for each user you would like to add one-by-one. Remember to modify the code below to match your user's details...