locked
Delete documents from Document Library after 30 days of creating. RRS feed

  • Question

  • Hi Friend,

                I want to delete documents after some time interval as suppose 30 days after they created in sharepoint library. I dont want to hide them using filter. I just want to delete them from sharepoint. How can i do this?


    • Edited by satish_p Sunday, October 23, 2011 12:13 PM
    Sunday, October 23, 2011 11:49 AM

Answers

  • Hi,

    before you start coding use a retentions policy for the documents of your library. It is much smarter and could be changed anytime you like later on. The information to set up these stuff i recommend to check out:

    How to configure Document expiration policy

    This blog entry describe exactly your situation.

    /Stefan

     


    http://www.n8d.at/blog
    Follow me on Twitter: StFBauer | n8design
    Microsoft Community Contributor 2011
    MCTS - SharePoint / WSS Configuration and Development
    Sunday, October 23, 2011 12:25 PM

All replies

  • Hi Satish,

    you can create a  timer job and schedule it every day, the timer job would have the logic to check if the document was created 30 days from todays date, then delete the document.


    http://moss-solutions.blogspot.com/
    Sunday, October 23, 2011 12:16 PM
  • Hi,

    You can do one of the following:

    1. Delete this document with a SharePoint Designer Workflow (after Delaying for 30 days - goto Delete Item in the link).

    2. Activate Retention Policy on the document library, and delete the document after 30 days.

     

    Hope this helps :)


    Mor Shemesh.
    • Edited by Mor Shemesh Sunday, October 23, 2011 12:34 PM
    Sunday, October 23, 2011 12:18 PM
  • Hi,

    before you start coding use a retentions policy for the documents of your library. It is much smarter and could be changed anytime you like later on. The information to set up these stuff i recommend to check out:

    How to configure Document expiration policy

    This blog entry describe exactly your situation.

    /Stefan

     


    http://www.n8d.at/blog
    Follow me on Twitter: StFBauer | n8design
    Microsoft Community Contributor 2011
    MCTS - SharePoint / WSS Configuration and Development
    Sunday, October 23, 2011 12:25 PM
  • How to create a timer job that does this?
    Tuesday, May 24, 2016 4:16 AM
  • Did you managed to find a solution to this? The answer provided by Stefan is incorrect. The blog entry under his answer is only for sharepoint 2007..
    Tuesday, May 24, 2016 4:17 AM