Office 365, setting mailbox permissions

      No Comments on Office 365, setting mailbox permissions

While looking for a method to migrate Office 365 mail i have notices that quite a few blogs copy/paste information without actually testing the procedure.

$AdminUser = berrydejager
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

$MBXS = Get-Recipient -RecipientType UserMailbox

ForEach ($MBX in $MBXS)
Write-Host $
Add-MailboxPermission $ -User $AdminUser -AccessRights FullAccess -InheritanceType All

Write-Host $
$PSTFile = "C:\_PST\Mailbox_$" ## add Your new PST file name path
Write-Host $PSTFile
$outlook = New-Object -ComObject outlook.application
$namespace = $Outlook.GetNameSpace("MAPI")
$NameSpace.AddStore($PSTFile) ## Add the new PST to the Current profile
$NEWStore = $namespace.Stores | ? {$_.filepath -eq $PSTFile} ## Get the New Store

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.