Enable Item Scheduling in SharePoint 2010

In this article we will be seeing how to enable item scheduling in SharePoint 2010.

I have created a document library "Doc Library".

Go to Document Library (Doc Library) => Library Settings => General Settings =>Manage Item Scheduling => you will be getting the following error message.






Go to Document Library (Doc Library) => Library Settings => General Settings =>Versioning Settings =>Do the following










Go to Document Library (Doc Library) => Library Settings => General Settings =>Manage Item Scheduling => now you will be able to enable item scheduling.







Programmatically enable or disable item scheduling:

a. Open Visual Studio 2010.

b. Create Console application.

c. Replace the code with the following.

  1. using System;

  2. using System.Collections.Generic;

  3. using System.Linq;

  4. using System.Text;

  5. using Microsoft.SharePoint;

  6. using System.Reflection;

  7. namespace ItemScheduling

  8. {

  9. class Program   

  10. {

  11. static void Main(string[] args)       

  12. {

  13. using (SPSite site = new SPSite("http://serverName:1111/"))           

  14. {

  15. using (SPWeb web = site.RootWeb)               

  16. {

  17. SPList list=web.Lists["Shared Documents"];                   

  18. list.EnableModeration = true;                    

  19. list.EnableMinorVersions = true;                   

  20. list.Update();

  21. //To enable Scheduling in the list                  

  22. Microsoft.SharePoint.Publishing.PublishingWeb.EnableScheduling(list);

  23. //To disable Scheduling in the list                   

  24. Microsoft.SharePoint.Publishing.PublishingWeb.DisableScheduling(list);               

  25. }           

  26. }       

  27. }   

  28. }

  29. }

d. Hit F5.


Using PowerShell enable or disable item scheduling:

  1. $site=Get-SPSite "http://serverName:1111/"

  2. $web=$site.RootWeb

  3. $list=$web.Lists

  4. $list.EnableModeration=$true

  5. $list.EnableMinorVersions=$true

  6. # To enable Scheduling in the list [Microsoft.SharePoint.Publishing.PublishingWeb]::EnableScheduling($list)

  7. # To disable Scheduling in the list [Microsoft.SharePoint.Publishing.PublishingWeb]::DisableScheduling($list)