Fix: Office 365 This user’s on-premises mailbox has not been migrated to Exchange Online when using dirsync

“This user’s on-premises mailbox has not been migrated to Exchange Online. The Exchange Online mailbox will be available once migration is completed”

This only happens for users that have been synced using DirSync as they are mail enabled with on premises exchange. I do not however want to migrate mailboxes and would like to start a fresh.

To fix this, one should exclude the attribute ‘msExchMailboxGuid‘ on the Azure Active Directory Connect Tool (DirSync).

-Disable Synchronization from the Office 365 Portal
-Delete all synched users (marked as cloud now)
-Remove these mailboxes from the Office 365 Recycle Bin
-Edit the MIIS so the MSExchangeMailboxGUID does not sync
-Enable Sync again


Fix Error 0x80041820 when searching through OWA

When searching through OWA you might end up with an error saying “The action couldn’t be completed. Try again later“, while users using Microsoft Outlook don’t have any issue.

You might also see the below errors in the event viewer

Log Name: Application
Source: MSExchangeIS Mailbox Store
Event ID: 9842
Task Category: Content Indexing
Level: Error
Function CISearch::EcGetRowsetAndAccessor detected that content indexing was disabled for database ‘‘ because of error ‘0x80041820’ from MSSearch.

Log Name: Application
Source: MSExchangeIS Mailbox Store
Event ID: 9877
Task Category: Content Indexing
Level: Error
Content Indexing function ‘CISearch::EcGetRowsetAndAccessor’ received an unusual and unexpected error code from MSSearch. Mailbox Database: Error Code: 0x80043629

This can be solved by doing the following steps

– Check the version of Exchange 2010 installed by running Get-ExchangeServer | Format-List Name, Edition, AdminDisplayVersion (So, version 14.2 is SP2, 15.00 is SP3. If you are still using SP1 I strongly recommend to upgrade to at least SP2).
– Download the correct Service Pack and extract it.
– Run Setup /PrepareAD and Setup /PrepareSchema.
– After this is done restart the services Microsoft Exchange Search Indexer and Microsoft Exchange Information Store.

If this doesn’t work, use the following steps

– Download the script Repair-ExchangeSearchSymlinks.ps1 from the Script Center and copy it to C:\Program Files\Microsoft\Exchange Server\v14\Scripts
– Open Exchange Management Shell and browse to the above folder.
– Run the script with ./Repair-ExchangeSearchSymlinks.ps1
– After this is done restart the services Microsoft Exchange Search Indexer and Microsoft Exchange Information Store.

One last step if this doesn’t work is to reset the indexer and start indexing of the database by doing

– .\ResetSearchIndex.ps1 [-force] []…
– You will receive an Event ID 109 when the rebuilding of the index starts for each database and an Event ID 110 for each database when the index rebuild has completed.
– After receiving Event ID 110 for each database, test to make sure search functions correctly with both OWA and Outlook operating in Online Mode.


Fix: The backup set holds a backup of a database other than the existing

When restoring a database from an SQL backup .bak, one usually creates a database and then selects the restore function. As soon as you try to restore the database you get the error saying “The backup set holds a backup of a database other than the existing“. This is because it fails to read the files from the restore and matching them to the newly created files.

The error says:

Restore failed for Server ‘SQLSRV01’. (Microsoft.SqlServer.SmoExtended)
Additional Information
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The backup set hold a backup of a database other an the existing ‘test_restore’ database.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)

To solve this one should do the following:

– Don’t create an empty database and restore the .bak file on to it.
– Use ‘Restore Database’ option accessible by right clicking the “Databases” branch of the SQL Server Management Studio and provide the database name while providing the source to restore.

This should allow you to restore the database with no error and fix the error 3154.


Fix: Hyper-V backup General access denied error (0x80070005)

When taking a backup using Windows Server Backup and during the backup you get an error as below

Writer Failures
Writer Id: {1072AE1C-E5A7-4EA1-9E4A-6F7964656570}
Instance Id: {017311EA-59CE-4B2E-830C-558BE6CEB39A}
Writer Name: Cluster Shared Volume
VSS Writer Writer State: 5
Failure Result: 80042336
Application Result: 80004005
Application Message: (null)
Component: BE389042-38BD-483E-9FD9-7E0F4CA466E466841cd4-6ded-4f4b-8f17-fd23f8ddc3de:c336e204-fbe8-46a4-a80d-faed6edafd94:SRVDCHVS02
Logical Path: (null)
Component Result: 800423F4 Component Message: Could not create backup checkpoint for virtual machine 'HYPDCORA01': General access denied error (0x80070005). (Virtual machine ID BE389042-38BD-483E-9FD9-7E0F4CA466E4) File Spec: C:\ClusterStorage\Volume1\virtual_machines\HYPDCORA01\Virtual Machines\\BE389042-38BD-483E-9FD9-7E0F4CA466E4.xml Recursive: 0 File Spec: C:\ClusterStorage\Volume1\virtual_machines\HYPDCORA01\Virtual Hard Disks\\HYPDCORA01.vhdx Recursive: 0 File Spec: C:\ClusterStorage\Volume2\\Oracle_Data.vhdx Recursive: 0 File Spec: C:\ClusterStorage\Volume1\virtual_machines\HYPDCORA01\Snapshots\\BE389042-38BD-483E-9FD9-7E0F4CA466E4-BackupSnapshot.xml Recursive: 0 File Spec: C:\ClusterStorage\Volume1\virtual_machines\HYPDCORA01\Virtual Hard Disks\\HYPDCORA01-ChildVhd.avhdx Recursive: 0 File Spec: C:\ClusterStorage\Volume2\\Oracle_Data-ChildVhd.avhdx Recursive: 0

After some research I found that it can be easily fixed. The issue occurs because most probably you have created a Shared volume and the VHDX file or Virtual Drive is in the root of the volume. To fix this, create a new folder called ‘Virtual Drives’ or whatever you wish and move the Virtual Drives onto that folder.

Restart the backup process and the issue will not occur


How to: Check if port is open with Powershell

For sys admins it is important to know if ports of certain applications are open for monitoring. One simple solution is to have a monitoring software, but if you want a cheap and cheerful solution, you can use Powershell. This can be done by the below script.

The below script will check the server/port and if the port is open, it will just print on screen saying “PORT IS OPEN – OK” and if the port is not open or the service is down, it will send and email.

Feel free to change or add to this script. You can easily put this in a loop to check all the services in your enterprise.

$MailServer = ""
$MailTo = ""
$MailFrom = "IT <>"
$MailBody = "Please note that the server is not reachable in this test that runs every 10 minutes. Please check the status of the server."
$Server = "SQLSRV01"
$Server_port = "1433"

$socket = New-Object Net.Sockets.TcpClient
$ErrorActionPreference = 'SilentlyContinue'

#Server and port
$ErrorActionPreference = 'Continue'

if ($socket.Connected) {
Write-Host "POST IS OPEN - OK"
send-mailmessage -To $MailTo -from $MailFrom -Subject $MailSubject -body $MailBody -smtpserver $MailServer -BodyAsHtml -Encoding ([System.Text.Encoding]::UTF8)

$socket = $null


How to: Powershell list all computers in Active Directory

Sometimes you would need to have a list of all the computers joined to the domain in your infrastructure. Instead of going through all the Organizational Units (OUs) in your AD infrastructure and listing all the computers, you can easily use the below Powershell Script.

Import-Module ActiveDirectory
$ComputerName = get-ADComputer -Filter * | Select -Expand Name
Foreach ($CN in $ComputerName)
{  write-host $CN}

This will type a list of all the computers joined in your AD infrastructure.  Save it to a file with extension PS1 and run it. If you would like to save the output to file simply run the file by adding > filename.txt and replace the write-host with write-output


Fix: Your automatic reply settings cannot be displayed because the server is unavailable

When setting up the automatic reply and out of office from your Outlook 2010 having Exchange 2010 you might have the problem with a pop-up saying “Your automatic reply settings cannot be displayed because the server is unavailable”.

I have managed to solve this with a DNS record in your infrastructure. Create the following SRV record to fix the issue.

Service: _autodiscover
Protocol: _tcp
Port Number: 443
Host: myexchangeserver.mydomain.local

On the client PC run the following to refresh the DNS. Make sure you run the CMD as Administrator

ipconfig /flushdns
ipconfig /registerdns

This should fix the problem and the user will be prompted to enter his Out of office settings.


Fix: No remote desktop license server is specified

After installing the licenses on your Windows 2008 R2 and upper for Terminal services and activated both the license and server you might have a popup message saying No Remote Desktop license server is specified. Also when you open the Remote Desktop Session Host Configuration you might see a similar message under the licensing diagnosis.

To fix this issue you must specify the Remote Desktop Services License Server. This can be done by the following:

Open the Remote Desktop Session Host Configuration from the Administrative Tools
Left click on the RD Session Host Configuration node
Double click on the Remote Desktop license servers
Add the server where the licenses have been installed

This should solve the issue and stop the message from showing


How to: Delete and re-create the Exchange ECP Virtual Directory

To delete the ECP virtual directory of your Exchange server and re-create it from scratch, you can use the below to get the identity of the virtual directory.

get-EcpVirtualDirectory |fl

Use this to remove the virtual directory in question

Remove-EcpVirtualDirectory -identity "MYSERVER\ecp (Exchange Back End)"

Create the new virtual directory use the below

New-EcpVirtualDirectory -externalurl "" -internalurl "https://myserver/ecp" -Server "myserver.mydomain.local"


Fix: Error 500 when loading Shell or ECP on Exchange 2013 SP1

After installing Exchange 2013 with SP1 you might notice that when you open the Management Shell, you will get a bunch of errors with mainly the error 500: Internal Server Error. This can also be seen when you try to access the ECP or OWA on the server in question. This issue is only on Exchange 2013 with SP1 and with Client Access role installed.

The culprit can be the following three:

#1 Time synchronization

On the Primary Domain Controller (PDC) do the below

net stop w32time
w32tm /config /syncfromflags:manual /
w32tm /config /reliable:yes
net start w32time

On the other DCs and servers do the following

net stop w32time
w32tm /config /syncfromflags:domhier /reliable:no /update
net start w32time

#2 Kerberos issues

Do the following on the effected servers to re-create the Powershell virtual directory.

Get-PowerShellVirtualDirectory -Server | Remove-PowerShellVirtualDirectory
New-PowerShellVirtualDirectory -Server -Name PowerShell
Get-PowerShellVirtualDirectory -Server | Set-PowerShellVirtualDirectory -BasicAuthentication:$false

After virtual directory re-creation I have checked its modules in IIS and made sure, that Kerberos module is native and the path to its DLL is correct.

#3 WinRM Extensions

The feature might be missing, do the below to add the feature

Get-WindowsFeature *IIS* #to check if it is installed
Add-WindowsFeature Winrm-IIS-Ext # to install