[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1051
  • Last Modified:

Send e-mail to admin of unused (never opend) sharepoint documents

I try to somehow get sharepoint to send an email to the administrator when a document is not used for a long time. Take for example 1 year. With "not used"  I mean not even opened.

As we got MOSS, I thougt of using a Policy, but it only has "Last modified" and "created" as dates to choose from, not "Last opened" or similar.

The link bellow shows me how to make a custome policy so I can connect the Due Date to another propertie, but I canĀ“t find a "last opened" property.

http://blah.winsmarts.com/2008-10-Authoring_custom_expiration_policies_and_actions_in_SharePoint_2007.aspx

what I'm thinking about now is to create a custom date-property named "last opened" and then bring it to the current date when a document is opened. But I can not find an event that starts when a document is opened.

Summary:

1. Can you send e-mail to admin of unused (never opend) sharepoint documents out of the box in MOSS?
2. If not, is there an event that fires when an document is opend?
0
einarbrown
Asked:
einarbrown
  • 2
1 Solution
 
Sushanta SahuPrincipal Specialist, Information ManagementCommented:
I think the audit logs have the details stored. Check the audit logs if they can be of any help. Generally any event i.e, opening, editing, deleting etc is being captured in the audit logs. But the audit log should be enabled from Central Admin as well as from the site collection administration properties.

Let me know how it goes.
0
 
einarbrownAuthor Commented:
Thanks!

That made me thinking of making a job that runs every night and looks for old documents.

Hope that can help me...
 SPList dokumentlist = website.Lists["Dokument"];

                foreach (SPListItem item in dokumentlist.Items)
                {
                    SPAuditEntryCollection auditcoll;
                    auditcoll = item.Audit.GetEntries();

                    foreach (SPAuditEntry entry in auditcoll)
                    {
                        if ((entry.Event == SPAuditEventType.AuditMaskChange || entry.Event == SPAuditEventType.View) && entry.Occurred.CompareTo(DateTime.Now.AddYears(-2)) == -1)
                        {
                            string emailBody = "This document has not been using for a 2 years: " + item.Web.Url + item.Url;
                            SPUtility.SendEmail(website, false, false, "admin@web.com", "Subject", emailBody);
                        }
                    }
                }

Open in new window

0
 
einarbrownAuthor Commented:
Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now