Event ID: 8193 Volume Shadow Copy Service error: Unexpected error calling routine

While doing a SharePoint installation at one of my clients using AutoSPInstaller, I kept having problems with the SharePoint Search Provisioning. After looking in the Event Logs, I found that there was an Access Denied Error on a certain Registry Key. The Event ID is 8193. Usually, the Event Viewer shows you what account has an access denied, but this time it wasn’t the case!

Event ID 8193 from VSS in Event Viewer with the Volume Shadow Copy Service access denied error and User field N/A

Also, for Search purposes, here is the error from AutoSPInstaller

Exception : System.Management.Automation.MethodInvocationException: Exception calling “Unprovision” with “0” argument(s): “The executing code must run on server SPWFE1.” —> System.InvalidOperationException: The executing code must run on server SPWFE1.

And the error from the event viewer:

Volume Shadow Copy Service error: Unexpected error calling routine RegOpenKeyExW(-2147483646,SYSTEM\CurrentControlSet\Services\VSS\Diag,…). hr = 0x80070005, Access is denied.

Operation:

Initializing Writer

Context:

Writer Class Id: {0ff1ce15-0201-0000-0000-000000000000}

Writer Name: OSearch15 VSS Writer

Writer Instance Name: OSearch15 Replication Service

Writer Instance ID: {a7e6cfde-ea80-43fa-b33e-e5b879a27133

So I went in the Event “Details” Tab to try and find more about the error, but at the first look, nothing displayed more info about the account name.

Event ID: 8193

However, when we scroll down in the Event Viewer, there is a “Binary to Word” translation that helps us a lot more! When we look at it, we can see the account number on multiple lines!

Details tab of Event 8193 in Friendly View where the binary to text column reveals the Services account user name

It was my Services account who didn’t have access to a registry key! To fix the error, do the following steps >

  1. Open regedit as an Administrator.

  2. Navigate to HKLM > System > Current Control Set > Services

    Registry Editor expanded to HKEY_LOCAL_MACHINE, SYSTEM, CurrentControlSet, Services

  3. Then find the “VSS” folder!

    VSS key under Services in the Registry Editor with its Diag, Providers and Settings subkeys

  4. Right click on the “VSS” folder. And then click on permissions,

    Right-click context menu on the VSS registry key in Registry Editor with Permissions highlighted

  5. Add the account that had an Access Denied and found earlier in the script and give it Full Control as it needs Read & Write to the VSS!

    Permissions for VSS dialog with the Services account added and Full Control allowed

  6. You should make sure that this account has access to the VSS Registry key on all the SharePoint Servers in the farm having a search Component. I recommend doing a reboot after changing the registry key, however it should work without one!

Now your Search provisioning should work without any problem!