[Solved] FSRM error 0xC00CEE22

Context

I ran into the following error on several FSRM servers

And I got the same error nearly with every FSRM cmdlet.

Cause

I got this error because the FSRM service was not able to read the <driveletter>:\System Volume Information\SRM\quota.xml file.

In my case, the FSRM service was not able to read the quota file because we inserted some special characters in the body property and FSRM didn’t escape them when they were written to the quota.xml file.

Solution

Change permissions and attributes

By default, the file is only accessible to the System account.

Furthermore, it is a hidden system file.

To work around this situation, I used once again a few cmdlets from the very good module of Raimund Andree named NTFSSecurity and which is available on the PowerShell Gallery.


Install-Module -Name NTFSSecurity -Repository PSGallery

And now here is how to proceed:

  1. Set the local Administrators group as owner on the System Volume Information folder.
    Set-NTFSOwner -Path 'P:\System Volume Information' -Account '.\Administrators'
  2. Give your account Full Control permissions on the System Volume Information folder and subobjects. Of course, this account must be an administrator on the computer.
    Add-NTFSAccess -Path 'P:\System Volume Information' -Account 'MyDomain\MyAdminAccount' -AccessRights FullControl -AccessType Allow -AppliesTo ThisFolderSubfoldersAndFiles
  3. Remove System and Hidden attributes on the quota.xml file.
    Note: Don’t forget the Force parameter because it allows the Get-Item cmdlet to list hidden files.

    (Get-Item 'P:\System Volume Information\SRM\quota.xml' -Force).Attributes = [System.IO.FileAttributes]::Normal
  4. And now, the most important part: make a copy of your original quota.xml file!!!
    $CurrentFile = (Get-Item -Path 'P:\System Volume Information\SRM\quota.xml').FullName$BackupFile = '{0}.COPY' -f $CurrentFileCopy-Item -Path $CurrentFile -Destination $BackupFile

Edit the XML file

  1. Download the latest version of XML Notepad, which is at the time of this writings version 2007, but it does the job.
  2. Stop the FSRM service
    Stop-Service -Name SrmSvc -Force
    
  3. Opened the XML file with XML Notepad.
    If you have an unescaped character, you get an error message indicating where the buggy character is located.
  4. Open the quota.xml file with a text editor (like Notepad++) which allows you to go to a specific character location (in the case of my screenshot it’s 16471).
  5. Replace special characters with the matching escape string
    • ‘ must be replaced by & #39;
    • ” must be replaced by &quot;
    • < must be replaced by &lt;
    • > must be replaced by &gt;
    • & must be replaced by &amp;
  6. Restart steps 3 to 6 until you can open the XML file without any error
  7. Start the FSRM service.
    Start-Service -Name SrmSvc,SrmReports
    

Et voilà!

More about

File Server Resource Manager (FSRM) overview (Microsoft Docs)

The File Server Resource Manager PowerShell module (Microsoft Docs)

Escaping XML characters (Stack Overflow)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s