从FSRM任务运行AD RMS PowerShell时出错-2012R2

从FSRM任务运行AD RMS PowerShell时出错-2012R2,powershell,rms,Powershell,Rms,尝试运行FCI PowerShell脚本时遇到问题。请参阅下面的错误 我创建了一个精简版本的脚本,它基本上只包含Protect-RMSFilecmdlet,并得到与上面相同的错误。这是ADRM的前提。当我从文件服务器资源管理器文件管理任务

尝试运行FCI PowerShell脚本时遇到问题。请参阅下面的错误

我创建了一个精简版本的脚本,它基本上只包含
Protect-RMSFile
cmdlet,并得到与上面相同的错误。这是ADRM的前提。当我从
文件服务器资源管理器
文件管理任务
立即运行文件管理任务
运行任务时,调试日志显示错误。我以本地系统的身份运行任务。我曾读到,可能需要将一些ipsec*DLL复制到不同的文件夹中,并且这样做了

如果我直接从PowerShell运行
Protect RMSFile
,它将完美地执行并按预期保护文件。如果将同一命令作为文件管理任务运行,则会出现错误

[2017-05-16T08:53:44.5232269-07:00] [INFORMATIONAL] [214] Logging location : C:\Users\Default\AppData\Local\Microsoft\MSIPC\pscmdlet\Logs\debug.log ["C:\\Users\\Default\\AppData\\Local\\Microsoft\\MSIPC\\pscmdlet\\Logs\\debug.log"]
[2017-05-16T08:53:44.6638518-07:00] [INFORMATIONAL] [215] Working directory : C:\Windows\TEMP\RMSProtection\4o1gco3x.xjl ["C:\\Windows\\TEMP\\RMSProtection\\4o1gco3x.xjl"]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] Calling IpcInitialize... ["Calling IpcInitialize..."]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] Calling IpcSetStoreName... ["Calling IpcSetStoreName..."]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] IpcSetStoreName successful... ["IpcSetStoreName successful..."]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] IpcInitialize successful ["IpcInitialize successful"]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] +IpcSetApplicationId ["+IpcSetApplicationId"]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] +IpcSetApplicationId ["+IpcSetApplicationId"]
[2017-05-16T08:53:44.6638518-07:00] [VERBOSE] [401] Client mode already initialized ["Client mode already initialized"]
[2017-05-16T08:53:44.6794764-07:00] [INFORMATIONAL] [301] Starting Protection Version : 2.0.0.0 ["Protection","2.0.0.0","2017-05-16 15:53:44Z"]
[2017-05-16T08:53:44.6794764-07:00] [VERBOSE] [401] Starting 2.0.0.0 Version : 2017-05-16 15:53:44Z ["Starting 2.0.0.0 Version : 2017-05-16 15:53:44Z"]
[2017-05-16T08:53:44.6794764-07:00] [INFORMATIONAL] [212] Component : 'File1-415e47b19d2b.pdf' moved from 'New' to 'Protected' ["File1-415e47b19d2b.pdf","New","Protected"]
[2017-05-16T08:53:44.6794764-07:00] [VERBOSE] [204] Protecting : File1-415e47b19d2b.pdf ["File1-415e47b19d2b.pdf"]
[2017-05-16T08:53:44.6794764-07:00] [VERBOSE] [205] Encrypting : C:\PROTECTED\2\OUTPUT\File1-415e47b19d2b.pdf ["C:\\PROTECTED\\2\\OUTPUT\\File1-415e47b19d2b.pdf"]
[2017-05-16T08:53:44.6794764-07:00] [VERBOSE] [401] Calling IpcfEncryptFile ["Calling IpcfEncryptFile"]
[2017-05-16T08:53:44.6951020-07:00] [VERBOSE] [401] Calling IpcCreateLicenseFromTemplateId... ["Calling IpcCreateLicenseFromTemplateId..."]
[2017-05-16T08:53:44.7263515-07:00] [INFORMATIONAL] [212] Component : 'File1-415e47b19d2b.pdf' moved from 'Protected' to 'Errored' ["File1-415e47b19d2b.pdf","Protected","Errored"]
[2017-05-16T08:53:45.0232260-07:00] [ERROR] [504] Error protecting File1-415e47b19d2b.pdf with error: The system cannot find the file specified. HRESULT: 0x80070002
at Microsoft.InformationProtectionAndControl.SafeNativeMethods.ThrowOnErrorCode(Int32 hrError)
at Microsoft.InformationProtectionAndControl.SafeNativeMethods.IpcCreateLicenseFromTemplateId(String templateId)
at RMSProtection.Core.Protection.FileProtection.BuildLicense(FileProtectionConfig config)
at RMSProtection.Core.Protection.FileProtection.<>c__DisplayClass3.<Protect>b__1()
at RMSProtection.Core.Protection.FileProtection.EncryptFile(Func`1 action, FileSystemInfo sourceFile)
at RMSProtection.Core.Protection.Protector.ProtectFile(Component component, FileSystemInfo file, FileProtectionConfig options)
at RMSProtection.Core.Protection.Protector.Protect(Component component, FileProtectionConfig options) ["File1-415e47b19d2b.pdf","The system cannot find the file specified. HRESULT: 0x80070002","   at Microsoft.InformationProtectionAndControl.SafeNativeMethods.ThrowOnErrorCode(Int32 hrError)\r\n   at Microsoft.InformationProtectionAndControl.SafeNativeMethods.IpcCreateLicenseFromTemplateId(String templateId)\r\n   at RMSProtection.Core.Protection.FileProtection.BuildLicense(FileProtectionConfig config)\r\n   at RMSProtection.Core.Protection.FileProtection.<>c__DisplayClass3.<Protect>b__1()\r\n   at RMSProtection.Core.Protection.FileProtection.EncryptFile(Func`1 action, FileSystemInfo sourceFile)\r\n   at RMSProtection.Core.Protection.Protector.ProtectFile(Component component, FileSystemInfo file, FileProtectionConfig options)\r\n   at RMSProtection.Core.Protection.Protector.Protect(Component component, FileProtectionConfig options)"]
[2017-05-16T08:53:45.0232260-07:00] [LOGALWAYS] [602] Id : 1, Type : FileLeaf, Description : File1-415e47b19d2b.pdf, Location : File1-415e47b19d2b.pdf, TempFilePath: C:\PROTECTED\2\OUTPUT\File1-415e47b19d2b.pdf, Error : Failed to protect ["1","FileLeaf","File1-415e47b19d2b.pdf","File1-415e47b19d2b.pdf","C:\\PROTECTED\\2\\OUTPUT\\File1-415e47b19d2b.pdf","Failed to protect"]
[2017-05-16T08:53:45.0232260-07:00] [VERBOSE] [401] 1 ["1"]
[2017-05-16T08:53:45.0232260-07:00] [INFORMATIONAL] [302] Completed Protection after '0:00:00.3480937', successfully completed processing of 0 of 1 items, failed processing 1 of 1 ["Protection","0:00:00.3480937",0,1,1]
[2017-05-16T08:53:44.5232269-07:00][information][214]记录位置:C:\Users\Default\AppData\Local\Microsoft\MSIPC\pscmdlet\Logs\debug.log[“C:\\Users\\Default\\AppData\\Local\\Microsoft\\MSIPC\\pscmdlet\\Logs\\debug.log”]
[2017-05-16T08:53:44.6638518-07:00][information][215]工作目录:C:\Windows\TEMP\RMSProtection\4o1gco3x.xjl[“C:\\Windows\\TEMP\\RMSProtection\\4o1gco3x.xjl”]
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]呼叫IPC初始化。。。[“正在调用IPCCinitialize…”
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]呼叫IpcSetStoreName。。。[“正在调用IpcSetStoreName…”
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]IpcSetStoreName成功。。。[“IpcSetStoreName成功…”
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]IPCCinitialize successful[“IPCCinitialize successful”]
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]+IpcSetApplicationId[“+IpcSetApplicationId”]
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]+IpcSetApplicationId[“+IpcSetApplicationId”]
[2017-05-16T08:53:44.6638518-07:00][VERBOSE][401]客户端模式已初始化[“客户端模式已初始化”]
[2017-05-16T08:53:44.6794764-07:00][information][301]启动保护版本:2.0.0.0[“保护”,“2.0.0.0”,“2017-05-16 15:53:44Z”]
[2017-05-16T08:53:44.6794764-07:00][VERBOSE][401]起始2.0.0.0版本:2017-05-16 15:53:44Z[“起始2.0.0.0版本:2017-05-16 15:53:44Z”]
[2017-05-16T08:53:44.6794764-07:00][information][212]组件:“File1-415e47b19d2b.pdf”从“新建”移动到“受保护”[“File1-415e47b19d2b.pdf”,“新建”,“受保护”]
[2017-05-16T08:53:44.6794764-07:00][VERBOSE][204]保护:File1-415e47b19d2b.pdf[“File1-415e47b19d2b.pdf”]
[2017-05-16T08:53:44.6794764-07:00][VERBOSE][205]加密:C:\PROTECTED\2\OUTPUT\File1-415e47b19d2b.pdf[“C:\\PROTECTED\\2\\OUTPUT\\File1-415e47b19d2b.pdf”]
[2017-05-16T08:53:44.6794764-07:00][VERBOSE][401]调用IpcfEncryptFile[“调用IpcfEncryptFile”]
[2017-05-16T08:53:44.6951020-07:00][VERBOSE][401]正在从TemplateId调用IPCreateLicenseFromTemplateId。。。[“调用IPCreateLicenseFromTemplateId…”
[2017-05-16T08:53:44.7263515-07:00][information][212]组件:“File1-415e47b19d2b.pdf”从“Protected”移动到“Errored”[“File1-415e47b19d2b.pdf”,“Protected”,“Errored”]
[2017-05-16T08:53:45.0232260-07:00][ERROR][504]保护文件1-415e47b19d2b.pdf时出错:系统找不到指定的文件。HRESULT:0x80070002
在Microsoft.InformationProtectionAndControl.SafeNativeMethods.ThrowOnErrorCode(Int32 HREError)中
位于Microsoft.InformationProtectionAndControl.SafeNativeMethods.IpcCreateLicenseFromTemplateId(字符串templateId)
位于RMSProtection.Core.Protection.FileProtection.BuildLicense(FileProtectionConfig)
在RMSProtection.Core.Protection.FileProtection.c__DisplayClass3.b__1()中
在RMSProtection.Core.Protection.FileProtection.EncryptFile(Func`1操作,FileSystemInfo源文件)
位于RMSProtection.Core.Protection.Protector.ProtectFile(组件组件、文件系统信息文件、文件保护配置选项)
在RMSProtection.Core.Protection.Protector.Protect(Component-Component,FileProtectionConfig options)[“File1-415e47b19d2b.pdf”,“系统找不到指定的文件。HRESULT:0x80070002”,“在Microsoft.InformationProtectionAndControl.SafeNativeMethods.ThrowOnErrorCode(Int32 hrError)”中\r\n位于Microsoft.InformationProtection和Control.SafeNativeMethods.IpcCreateLicenseFromTemplateId(字符串templateId)\r\n位于RMSProtection.Core.Protection.FileProtection.BuildLicense(FileProtectionConfig config)\r\n位于RMSProtection.Core.Protection.FileProtection.c\u DisplayClass3.b\u 1()\r\n位于RMSProtection.Core.Protection.FileProtection.EncryptFile(Func`1操作,FileSystemInfo源文件)\r\n位于RMSProtection.Core.Protection.Protector.Protect文件(组件组件,FileSystemInfo文件,FileProtectionConfig选项)\r\n位于RMSProtection.Core.Protector.Protect(组件,FileProtectionConfig选项)]
[2017-05-16T08:53:45.0232260-07:00][LOGALWAYS][602]Id:1,类型:FileLeaf,描述:File1-415e47b19d2b.pdf,位置:File1-415e47b19d2b.pdf,临时文件路径:C:\PROTECTED\2\OUTPUT\File1-415e47b19d2b.pdf,错误:保护失败[“1”,“FileLeaf”,“File1-415E47B19B.pdf”,“File1-415e47b19d2b.pdf”,“C:\\PROTECTED\\2\\OUTPUT\\File1-415e47b19d2b.pdf”,“未能保护”]
[2017-05-16T08:53:45.0232260-07:00][VERBOSE][401]1[“1”]
[2017-05-16T08:53:45.0232260-07:00][information][302]在“0:00:00.3480937”之后完成保护,成功完成1个项目中的0个项目的处理,失败处理1个项目中的1个[“保护”,“0:00:00.3480937”,0,1]

这不适用于AD RMS。错误“系统找不到指定的文件”与缺少的RMS策略模板文件有关。FSRM任务作为本地系统、本地服务或网络服务运行-无法根据MSIPC客户端引导这些帐户以按预期使用AD RMS策略模板

以下是我的建议: -使用最新AIP预览客户端的AIP Powershell cmdlet -退房