This article describes the steps and precautions for using the document library Scheduling in sharepoint2013.
The document library Scheduling (planned release function) is used to set that the document can be viewed by common users (non-Administrators, reviewers, and authors) within a specific time range after approval. To enable scheduling, you must first enable the content approval and minor version 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 when a new document library is created, the two columns are not automatically added. There are two solutions:
1. Use the system document library Template
A. Set the system document inventory 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. Then, 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 from the site column)
With 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