Creating file shares

Create two file shares on witness so that the VM instance can store SQL Server backups and act as a file share witness:

  1. Connect to witness by using Remote Desktop. Sign in with your domain user account.
  2. Right-click the Start button (or press Win+X) and click Windows PowerShell (Admin).
  3. Confirm the elevation prompt by clicking Yes.
  4. Create a witness file share and grant yourself and the two cluster nodes access to the file share.

    New-Item "C:\QWitness" –type directory
    
    icacls C:\QWitness\ /grant 'node-1$:(OI)(CI)(M)'
    icacls C:\QWitness\ /grant 'node-2$:(OI)(CI)(M)'
    
    New-SmbShare `
      -Name QWitness `
      -Path "C:\QWitness" `
      -Description "SQL File Share Witness" `
      -FullAccess $env:username,node-1$,node-2$
    
  5. Create another file share to store backups and grant SQL Server full access.

    New-Item "C:\Backup" –type directory
    New-SmbShare `
      -Name Backup `
      -Path "C:\Backup" `
      -Description "SQL Backup" `
      -FullAccess  $env:USERDOMAIN\sql_server