Transfer to another users mailbox on Office 365 & Exchange Server using PowerShell
If you are an Exchange administrator then you will come across the issue with leavers mailboxes needing to be transferred to another users mailbox. If you are looking after on-site exchange, then the process is slightly shorter as you don’t need to connect to the remote PowerShell. You simply log in to one of you exchange servers and run PowerShell as Administrator.
Then you run following command and check all completed correctly:
Search-Mailbox -Identity “Old User” -TargetMailbox “Current User” -TargetFolder “Old-Mailbox” -LogLevel Full
To do the same on Office 365 you need to connect to remote PowerShell.
Make sure your account is enabled for remote PowerShell. You will need to be a member of Office 365 Global Admins or you will need to ask one of the Global Admin users to enable remote PowerShell by running following command on the Remote PowerShell:
Set-User [email protected] -RemotePowerShellEnabled $true
Check TCP port 80 is open between your PC and Office 365.
Run PowerShell on your computer as Administrator.
First of all you will need to set your execution policy to Remote Signed:
Set-ExecutionPolicy RemoteSigned
Then save your credentials into a variable for later use, you will be prompted to insert them:
$usercredential = Get-Credential
Now we will save our session to a variable:
$session = New-PSSession -configurationname Microsoft.Exchange -connectionUri https://outlook.office365.com/powershell/ -credential $usercredential -authentication Basic -allowredirection
And then we will import it:
Import-PSSession $session
Now we can execute any commands we require, so in our case we want to transfer messages from one users mailbox to another, which is identical to the on-site exchange:
Search-Mailbox -Identity “Old User” -TargetMailbox “Current User” -TargetFolder “Old-Mailbox” -LogLevel Full
That’s all! You have now know to how transfer an old users mailbox to another users mailbox.
Have any further questions? Don’t hesitate to contact us via our email, book an appointment with us or or call us on 0330 1224 420
Questions: [email protected]
Continue reading:
Setting Permissions for Office 365 using Powershell to user another users Mailbox
Office 365 mailbox in different data centre
How to recover an Office 365 Mailbox Using Windows Powershell
[hubspot portal=”25047923″ id=”fbd0c3f3-487c-4414-affa-dee147818244″ type=”form”]
Recent Comments