kamagra how much to take

Invoking The RMS Bulk Protection Tool Remotely

I don’t understand why this was so hard, but it really is. And honestly who wants to use this tool directly on the server? It is more useful when you can bake it into client applications, in my case a VSTO add-in. Furthermore, the Microsoft site says this will work on XP, this is not the case since it will just throw Skipped, file type not supported. I don’t know what that’s about. Furthermore, if you try to invoke the encryption routines on the box while pointing to a network share hosting the application, like this:

  1. var start = new ProcessStartInfo
  2. {
  3. WorkingDirectory=Whatever
  4. Arguments = @" /encrypt \\server\shareimencrypting\ Rights.xml",
  5. FileName = @"RmsBulk.exe",
  6. WindowStyle = ProcessWindowStyle.Normal,
  7. CreateNoWindow = false,
  8. UseShellExecute = false
  9. };
  10. using (Process p = Process.Start(start))
  11. {
  12. p.WaitForExit();
  13. }

It will not work since it can’t hydrate the template file. Returns an error like “you do not have access to the template file or it does not exist”. Or something to that effect.  So, the only real way to do is to execute the task remotely. Since the standard output from the tool is pretty important for interaction purposes (tells supported file types and gives a report of failed / succeeded decryption routines, that pretty much means WMI is out the door since it won’t out a return. So, PSExec comes to the rescue! Or maybe something else this was just what the SP MVP group said would be the path of least resistance.

Long and short of it is, to execute it remotely make two local executables that reside in the shared RMSBulk tool directory (or as long as the wrapper classes for the IRM protector are relative to the tool), respectively:

  1. var start = new ProcessStartInfo
  2. {
  3. Arguments = @" /encrypt \\server\share\ Placitum_Rights.xml",
  4. FileName = @"RmsBulk.exe",
  5. WindowStyle = ProcessWindowStyle.Normal,
  6. CreateNoWindow = false,
  7. UseShellExecute = false
  8. };
  9. using (Process p = Process.Start(start))
  10. {
  11. p.WaitForExit();
  12. }

And for the decryption:

  1. var start = new ProcessStartInfo
  2. {
  3. Arguments = @" /decrypt \\server\share\",
  4. FileName = @"RmsBulk.exe",
  5. WindowStyle = ProcessWindowStyle.Normal,
  6. CreateNoWindow = false,
  7. UseShellExecute = false
  8. };
  9. Process p = Process.Start(start);
  10. p.WaitForExit();
  11.  
  12. }

Then in your client app, make the appropriate PSExec calls.

For the encryption:

  1. ProcessStartInfo startEncrypt = new ProcessStartInfo
  2. {
  3. WorkingDirectory = @"
  4. ",
  5. FileName = @"
  6. \PsExec.exe",
  7. WindowStyle = ProcessWindowStyle.Normal,
  8. CreateNoWindow = false,
  9. Arguments = @"\\ -u username -p password -w ""C:\Program Files (x86)\AD RMS Bulk Protection Tool"" ""C:\Program Files (x86)\AD RMS Bulk Protection Tool\Encrypt.exe""",
  10. UseShellExecute = false
  11. };
  12.  
  13. Process process = new Process();
  14.  
  15. process.StartInfo = startEncrypt;
  16. process.Start();
  17. process.WaitForExit();
  18. process.Close();

For the decryption:

  1. var startDecrypt = new ProcessStartInfo
  2. {
  3. WorkingDirectory = @"
  4.  
  5. FileName = @"
  6. \PsExec.exe",
  7. WindowStyle = ProcessWindowStyle.Normal,
  8. CreateNoWindow = false,
  9. Arguments = @"\\ -u username -p password -w ""C:\Program Files (x86)\AD RMS Bulk Protection Tool"" ""C:\Program Files (x86)\AD RMS Bulk Protection Tool\Decrypt.exe""",
  10. UseShellExecute = false
  11. };
  12.  
  13. Process process = new Process();
  14. process.StartInfo = startDecrypt;
  15. process.Start();
  16. process.WaitForExit();
  17. process.Close();

And you can get around 99% of the limitations of the tool. It’s pretty cool when you combine it with FCI, then really get fancy by ad-hoc provisioning plain-text indexing to support encrypted searching routines.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>