Skip to content

Resolve VSS Errors without Rebooting

VSS Errors are a fairly common occurrence, with most resolutions being “reboot the server”.

Each VSS Writer is linked to a Windows Service.

Often VSS Errors can be resolved by restarting the corresponding service.

The following PowerShell script will check the status of all VSS Writers and restart any services where the Writer doesn’t report “No error”.

We have scheduled this script to run every night before the backup on servers where VSS Errors are common.

$ServiceArray = @{
'ASR Writer' = 'VSS';
'Bits Writer' = 'BITS';
'Certificate Authority' = 'EventSystem';
'COM+ REGDB Writer' = 'VSS';
'DFS Replication service writer' = 'DFSR';
'Dhcp Jet Writer' = 'DHCPServer';
'FRS Writer' = 'NtFrs';
'IIS Config Writer' = 'AppHostSvc';
'IIS Metabase Writer' = 'IISADMIN';
'Microsoft Exchange Writer' = 'MSExchangeIS';
'Microsoft Hyper-V VSS Writer' = 'vmms';
'MS Search Service Writer' = 'EventSystem';
'NPS VSS Writer' = 'EventSystem';
'NTDS' = 'EventSystem';
'OSearch VSS Writer' = 'OSearch';
'OSearch14 VSS Writer' = 'OSearch14';
'Registry Writer' = 'VSS';
'Shadow Copy Optimization Writer' = 'VSS';
'Sharepoint Services Writer' = 'SPWriter';
'SPSearch VSS Writer' = 'SPSearch';
'SPSearch4 VSS Writer' = 'SPSearch4';
'SqlServerWriter' = 'SQLWriter';
'System Writer' = 'CryptSvc';
'WMI Writer' = 'Winmgmt';
'TermServLicensing' = 'TermServLicensing';
}
vssadmin list writers | Select-String -Context 0,4 'writer name:' | ? {$_.Context.PostContext[3].Trim() -ne "last error: no error"} | Select Line | %
{$_.Line.tostring().Split("'")[1]}| ForEach-Object {Restart-Service $ServiceArray.Item($_) -Force}
Back To Top