Exchange 2013 Troubleshooting: Error File share witness path '\Contoso.com\DAG' exists, but permissions are not correctly set. Account 'DAG$' must have full access.

Issue

Error File share witness path '\Contoso.com\DAG' exists, but permissions are not correctly set. Account 'DAG$' must have full access.

Symptom

Unable to run set-databaseavailablity group command

Set-DatabaseAvailabilityGroup -Identity DAG -WitnessServer FSW.CONTOSO.COM -WitnessDirectory C:\DAG

A server-side database availability group administrative operation failed. Error File share witness path ‘\fsw.contoso.com\DAG’ exists, but permissions are not correctly set. Account 'DAG$' must have full access...

Cause

Insufficient permissions to access file shares on witness server

Resolution

Assign the CNO ‘DAG’ full control over the file share witness directory and share.

  1. Right-click the file share witness directory 
  2. Choose Properties ->Security 
  3. Click Edit and Add the CNO 
  4. Assign Full Control Permission