Translate this site using Windows Live Translator:
A quick a dirty script to identify RMS content, and it's owner. - RMS: Protecting Your Assets. - Site Home - TechNet Blogs

RMS: Protecting Your Assets.

The Protecting 'My' Asset Disclaimer: This is my 'un-official', 'in my spare time', 'use at your own risk', all things RMS (Rights Management Services), IRM (Information Rights Management), IPP (Information Protection Pla

A quick a dirty script to identify RMS content, and it's owner.

A quick a dirty script to identify RMS content, and it's owner.

  • Comments 1
  • Likes

I wrote this script a while back that shows a quick way to scan all documents in a folder, and see if it is rights protected, then display the file name, and the owner. It's not pretty, but it gets the job done.

I had someone ask me for it, and it took a while to find it so now I'm posting it here. As usual..do some error checking, indenting, and clean-up work. :)

strFolder = "C:\RMSTest"  '*** Specify a folder here, or use an InputBox ****
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(strFolder)
Set objFiles = objFolder.Files
For each oFile in objFiles
 Set oStream = oFile.OpenAsTextStream
 Do While Not oStream.AtEndOfStream
  strString = oStream.ReadLine
  imid = instr(1,strString,"<OWNER>")
  ilen = instr(1,strString,"</OWNER>") - instr(1,strString,"<OWNER>")
  If instr(1,strString,"<OWNER>") then
   strString = mid(strString,imid,ilen)
   imid = instr(1,strString,"<NAME>")
   ilen = instr(1,strString,"</NAME>") - instr(1,strString,"<NAME>")
   strOwner = mid(strString,imid,ilen)
   strOwner = right(strOwner,len(strOwner)-6)
   exit Do
  Else
   strOwner = "Not RMS Protected"
  End If
 Loop
Wscript.Echo oFile.Name & ": " & strOwner
Next

-Jason

Comments
  • I'm wondering is it possible to create RMS-protected email using VBA?

    Could you please share some samples of doing that?

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment