Tuesday, August 7, 2012

SharePoint 2013: Site Retention - Getting Closure with Your Sites


Introduction

Site retention in SharePoint is governed by site policies. In SharePoint 2013, site policies have been improved. There is a new concept within SharePoint 2013 regarding sites:  Site Closure. When a site is closed it is essentially ignored by SharePoint in regards to displaying its existence, however, the site may still be accessed via URL.

Executive Summary

·         Site policies are created at the site collection level but then are applied at the site level (including the site collection root site).

·         Closure of a sub-site does not prevent any usage of the site and essentially places it in a deletion countdown state. Closure of a site collection, however, makes the site collection read-only (this includes any sub-sites).

·         Deletion of a site (or site collection) automatically removes sub-sites.

·         Site owners may postpone deletion for a specified period of time (controlled by the policy)



Close and Delete Sites Automatically

Creating a Site Policy

Site policies are created at the site collection level but then may be applied to underlying sub-sites.  To create a new site policy, follow these steps:

1.       Navigate to the site collection where you would like to create the site policy.

2.       Select Site Settings from the Settings menu (gear icon):


3.       Under the Site Collection Administration section, click on Site Policies:




The Site Policies page appears.

4.       Click on the Create link at the top of the page. The New Site Policy page appears:




5.       Enter a name for the policy and select Close and delete sites automatically. Various options appear.




Close Event:  The close event is based on a specified period of time after site creation. It may be in Days, Months, or Years. For testing purposes I chose 1 day.



Deletion Event:  The deletion event is based on a specified period of time after site closure. It may be in Days, Months, or Years. For testing purposes I chose 1 day.



Deletion email notification: You may choose to send an email to the site owner within the specified time to warn about future deletion of the site.



Follow-up notifications: You may choose to send follow-up notifications warning of site deletion based on the specified recurrence.



Deletion Postponement:  You may elect to allow site owners to postpone deletion for the specified period of time.





6.       Optional: Site Collection Closure. You have the option of closing the entire site collection when the policy is applied. Site collection closure places the site collection in read-only mode.


7.       Click OK to create the new policy. The new policy is created and appears in the Site Policies listing:




Applying a Site Policy to a Site

Once the site policy is created at the site collection level, it may be applied to sub-sites that exist within that site collection.  To apply a site policy to a sub-site, follow these steps:

1.       Navigate to the sub-site where you would like to apply the site policy.

2.       Select Site Settings from the Settings menu (gear icon).
3.       Under Site Administration click on the Site Closure and Deletion link:




                The Site Closure and Deletion page appears:


4.       Select the site policy to apply from the Site Policy drop-down:


5.       Click OK. The policy is applied to the site.
6.       If you click on the Site Closure and Deletion link again, you will see the Site Closure and Site Deletion results from the policy:


I clicked the postpone button so the site would not be deleted right away.

Results of the Site Closure

When a subsite is closed, it can still be accessed by users and modifications may occur. If the deletion of the site is coming soon (I believe within 30 days), there will be a message at the top of the screen:



When a site collection is closed, it can still be accessed by users but NO modifications may occur. The site collection becomes read-only. A notification of the read-only state and the deletion appear on the top of a site collection page:

Run a Workflow Automatically to Manage Site Closure

Although the automatic closure and deletion looks great, we need more control and functionality. One of the other site policy Site Closure and Deletion options is to “Run a workflow automatically to manage site closure, then delete them automatically”. 

When this option is selected, a drop-down to select the workflow appears:



The workflow may run on a recurring schedule if the site is not closed.

For our purposes, we need the workflow to perform the following actions:

1.       Send email to the site owner asking whether they are still using the site

2.       Process the owner’s answer of yes or no*

3.       If yes - do nothing - let policy kick off workflow again next year

4.       If no:

a.       Remove all permissions from site (except System Account)

b.      Mark site as closed  - site policy will then manage automatic deletion


This will most likely require either a) custom workflow activities for SPD Workflows or b) Visual Studio workflow. I am currently having issues getting SP Designer 2013 running properly but will update this post once I move forward with additional site retention proof-of-concepts.

*currently not sure how the user will interact with the workflow




18 comments:

  1. Great post. Thanks for sharing.

    ReplyDelete
  2. Great Post, looking forward to anything you share on the workflow side of this. I have a similar requirement.

    ReplyDelete
    Replies
    1. Thanks! I haven't moved forward with anything on this yet (nor has anyone on my team). I have been focused on the new Search experience and my colleagues are busily updating our custom code to use .NET Framework 4.5. Eventually...

      Delete
  3. Great post.

    One question: I cannot see "Run a Workflow Automatically to Manage Site Closure" on my SharePoint 2013 (Enterprise). I have enabled "Enterprise Features", and then enabled features on Existing Sites.

    Any idea?

    ReplyDelete
    Replies
    1. I no longer see that option anymore either. I originally investigated this using the Preview version. Maybe they took it out of the release.

      Delete
    2. Looks like that option button is set to Visible="false" now in the _layouts/15/ProjectPolicies.aspx page. Doesn't look like there is logic to turn it on either.

      I too enabled features and created a Site Workflow on the site to see if that activated the option. No deal.

      -=Steve

      Delete
  4. Fantastic post! A complex topic process made simple. Thank you.

    ReplyDelete
  5. Annoyingly the site remains in all navigation elements. If I have 100 projects and have closed 95 then I only want to see the five active ones. Any thoughts ???

    ReplyDelete
    Replies
    1. The only thing I can think of at the moment (while on holiday vacation) is to remove permissions from the closed sites. The site collection and farm admins will still see it but at least users won't.

      -=Steve

      Delete
    2. Nice one. Thanks and happy holidays.

      Delete
  6. Perhaps someone can confirm this in an E Plan Online SharePoint 365 (2013). After closing the site I can still add content. The site never goes read-only even though the policy has read-only ticked. Also I never see the message bar at the top of the screen. Others on different blogs have reported this also.

    ReplyDelete
    Replies
    1. I have discovered the answer to this so will post for folks who might be confused. Closed sub-sites never go read only. The read only check box is for the site collection (not the sites). So in my application - the whole concept of closing a site is pointless. (1) Closed sites still appear in the navigation elements and (2) closed sites are not made read-only - so users can easily add content to them. I think MS have got this feature very wrong indeed.

      Delete
  7. Missing Run a workflow to close the site, and delete the site automatically in office 365 and premises share point 2013 environments?

    ReplyDelete
    Replies
    1. Those options were in the Preview but apparently were removed in the release.

      Delete
  8. Great explanation but I am having an issue on just what permission level the site Owner has to have in order to see the Site Closure & Deletion link under Site Administration. My owners have Design rights but can't see them until I give them Full Control. Does this seem right?

    ReplyDelete
  9. correct. design rights alone won't cut it.

    ReplyDelete