Connect to Exchange Online PowerShell
Exchange Online PowerShell Modunle
You need install Exchange Online module only once. In the next time, run to connect to Exchange Online PowerShell.
Assign permission to all user mailboxes in the organization
##Connect to Exchange Online
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name ExchangeOnlineManagement;
Import-Module ExchangeOnlineManagement;
Connect-ExchangeOnline;
##Grant mailbox permission for all mailboxes
$AdminEmail = 'admin@leoguides.info'
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') -and (Alias -ne 'Admin')} | Add-MailboxPermission -User $AdminEmail -AccessRights fullaccess -InheritanceType all -AutoMapping:$false
Grant mailbox permission for a single mailbox
##Grant mailbox permission for a single mailbox
$UserMailbox = 'chris@leoguides.me'
$AdminMaibox = 'admin@leoguides.me'
Add-MailboxPermission -Identity $UserMailbox -User $AdminMaibox -AccessRights FullAccess -InheritanceType All -AutoMapping $false
5/5 - (1 vote)