Tuesday, 21 January 2020

Client reconnecting to Exchange 2010 after migrating to Office 365


After our first 365 migration we left the mail-server online to export more folders but had an annoying problem where after using Outlook for a while they would start trying to use the old server again as the mail server. It worked, but wasn't quite right - and eventually stopped working altogether.

The reason for this is that Outlook still looks on your local network for an auto-discover virtual directory - so if you need to keep the mail-server on be sure to remove the auto-discovery folder!


  • View your current autodicover information (I tend to take a screen grab)
    • Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity
  • Remove your autodiscover info (be sure to replace SERVER with your server name)
    • Remove-AutodiscoverVirtualDirectory -Identity “SERVER\Autodiscover (SBS Web Applications)”
    • Alternatively, read what the folder is called, as you may need to run
    • Remove-AutodiscoverVirtualDirectory -Identity "SERVER\Autodiscover (Default Web Site)"
And that should fix it!

Migrating from On Premise Exchange to Office 365 - upload PCs from the server

We're doing a lot of migrations at the moment; everyone seems to want to dump their on-premise exchange server and head to the cloud. I've read a lot about 365, but something managed to pass me by and this week (3rd migration) I've finally found out about it.

Importing PSTs to the 365 servers from their side; how I missed this I just don't know.

This new process has shaved a lot of time from the migrations, so here goes the new work routine:

1. End of play for the weekend; change MX records to point to 365 and turn off port 25 and 443 on networks firewall
2. Use Exchange Powershell to export all of the PST files from the server into a folder
3. Use AzCopy to upload the PSTs to Office 365
4. Create a mapping file and upload it to Office 365
5. Run the mapping file and import the PST files into the mailboxes
6. Add the accounts to all PCs and off we go

To do step 3 you need to get your SAS URL which is generated from the Office 365 portal and then enter it into the AzCopy cool (its basically the destination on an Azure cloud server).

Read the full Microsoft Documentation here

Here are a few useful commands that you may need following the above steps:
  • Having trouble exporting emails from the server because of bad items in a mailbox? use the below switches:
    • New-MailboxExportRequest -mailbox jsmith -filepath "\\server\PST\jsmith.pst" -baditemlimit 50000 -acceptlargedataloss
  • Need to view the progress?
    • Get-MailboxExportRequest
  • Want to clear the finished exports from the report?
    • Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
  • Here's an example from the mapping file:
    • Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,ContentCodePage,SPFileContainer,SPManifestContainer,SPSiteUrl
    • Exchange,,jsmith.pst,jsmith@contoso.co.uk,FALSE,/,,,,
  • Still having people connecting to the old server after migration? did you remember to turn auto-discovery off on the server? read me!


WordPress redirecting to Random Websites such as tomorrowwillbehotmaybe

A client recently had a problem with their WordPress site where it kept redirecting to a random URL - investigation showed that it went to tomorrowwillbehotmaybe in this instance.

The site hasn't been updated in a while (they are self client managed), and the issue appeared to be with a plugin called 301 simple redirect.

Disabling the plugin by renaming the plugin folder resolved the issue and the client could get back into the site as needed. Seems as though this particular plugin has a security hole in the older versions which got plugged - fine as long as the sites getting updated!