locked
Error when applying custom templates with Powershell "Protect-RMSFile : The system cannot find the file specified. HRESULT: 0x80070002" RRS feed

  • Question

  • I'm using PowerShell to protect a folder on a server that contains PDF and txt files. Using PowerShell I can apply the 2 default Azure RMS templates, however when I try and apply any of the custom templates that I created I get the following error. I even tried copying the default Azure RMS template with the same error...

    Protect-RMSFile : The system cannot find the file specified. HRESULT: 0x80070002
    At C:\Temp\FciRmsFileProtection.ps1:26 char:1
    + Protect-RMSFile -Folder $FolderToEncrypt -TemplateID $RmsTemplate -Recurse
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Protect-RMSFile], InformationProtectionException
        + FullyQualifiedErrorId : Microsoft.InformationProtectionAndControl.InformationProtectionException,Microsoft.Protection.PowerShell.ProtectRMSFile

    Friday, September 18, 2015 2:14 AM

All replies

  • Do you see the same thing if you are not using variables for -Folder and -TemplateID

    I'm not completely clear on your scenario since you state that it works with the default templates, and then that "copying" the default templates gives the same error.

    Do you mean you are creating new custom templates that are just duplicates of the existing default templates?

    Monday, September 28, 2015 3:59 PM
  • I've sorted the issues out. The RMS powershell cmdlets aren't available outside tenants in North America, so to get this working there was some registry modifications that needed to be made for these to work.
    • Proposed as answer by Eddie Bowers Monday, September 28, 2015 10:33 PM
    Monday, September 28, 2015 10:29 PM
  • It's important that you run Set-RMSServerAuthentication after you make these registry edits (see prerequisite #3 in https://msdn.microsoft.com/en-us/library/mt433202.aspx for registry instructions). I'll make this clearer in the docs.
    Tuesday, October 6, 2015 8:40 PM
  • I have the same problem.Firstly,I confirm that Protect-RMSFile works well. The actual issue is that Get-RMSTemplate command can not retrieve custom template.How to find the location of tenant and which registry to be modified? Thanks a lot.

    • Proposed as answer by Waldemar Wolak Thursday, September 8, 2016 8:12 AM
    • Unproposed as answer by Waldemar Wolak Thursday, September 8, 2016 8:12 AM
    Tuesday, January 5, 2016 8:47 AM