Use the document library Scheduling in SharePoint 2013 (planned release function)

Source: Internet
Author: User

This article describes the steps and precautions for using the document library Scheduling in sharepoint2013.

The document library scheduling is used to set that the documents can be viewed by common users (non-Administrators, approvers, and authors) within a specific time range after approval. To enable scheduling, you must first enable the content approval and minor version number control of the document library. This is the official document, but I have noticed that the draft item security must be set to only users who can approveitems (and the author of the item:


In addition, when scheduling is enabled on the system documentation library, Sharepoint automatically adds publishingexpirationdate (scheduling end date) and publishingstartdate (scheduling start date)




However, when scheduling is enabled again when a new document library is created, the above two columns are not automatically added. There are two solutions:

1. Use the system document library Template

A. Inventory the system documents as a template. If you cannot see the connection to another template, you can directly use/_ layouts/15/savetmpl. aspx? List = listid can be found in the document library settings, or you can directly change listedit. aspx to savetmpl. aspx:/_ layouts/15/listedit. aspx? List = % 7b1_ad054% 2dd81b % 2d495f % 2daa9f % 2d6e1_53a3b63% 7D

 

B. Use the document library template obtained in step a to create a document library. When scheduling is enabled for the newly created document library, the above two columns will be automatically added.

 

2. After scheduling is enabled, add the publishingexpirationdate (scheduling end date) and publishingstartdate (scheduling start date) columns to the site column)

Using powershell, you can write as follows:

Param(    [parameter(Mandatory=$true)]    [alias("web")]    $webUrl,    [parameter(Mandatory=$true)]    [alias("DocumentLib")]    $documentLibTitle  )  $webSite = get-SPWeb $webUrl $documentLib = $webSite.Lists[$documentLibTitle] Write-host "Enable content approval"  $documentLib.EnableModeration = $true Write-host "Enable minor version"  $documentLib.EnableMinorVersions = $true $documentLib.DraftVersionVisibility = 2;  # Only users who can approve items (and the author of the item), lib.DraftVersionVisibility = DraftVisibilityType.Approver $documentLib.Update() [Microsoft.SharePoint.Publishing.PublishingWeb]::EnableScheduling($documentLib); # Check if the list have the two column "Scheduling Start Date" and "Scheduling End Date" ## refresh the document library  $documentLib = $webSite.Lists[$documentLibTitle]  if(-Not($documentLib.Fields.ContainsFieldWithStaticName("PublishingStartDate"))) {            Write-host "Adding column Scheduling Start Date"             $listField=$webSite.Site.RootWeb.Fields["Scheduling Start Date"]$documentLib.Fields.AddFieldAsXml($listField.SchemaXml, $true, 4) # SPAddFieldOptions.AddToAllContentTypes = 4$documentLib.Update() }  if(-Not($documentLib.Fields.ContainsFieldWithStaticName("PublishingExpirationDate"))) {      Write-host "Adding column Scheduling Start Date"      $listField=$webSite.Site.RootWeb.Fields["Scheduling End Date"]     $documentLib.Fields.AddFieldAsXml($listField.SchemaXml, $true, 4) $documentLib.Update() }   $webSite.Dispose(); Write-host "Done!" -foregroundcolor green




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.