Feb 11 2022 04:41 AM
Hello,
Now we can enable Scheduling on Modern Site Pages:
I was looking at the CSOM API and did not find any way to accomplish this programmatically?
Does anyone know how to accomplish this?
If not CSOM, any alternatives? REST API? PnP Provisioning?
Thanks
Oct 27 2022 04:57 AM - edited Oct 27 2022 05:35 AM
In case you are still interested in knowing this, or maybe someone else comes across this question. Scheduling publishing for a SharePoint modern page in SharePoint online can be done as follows.
Connect-PnPOnline https://test.sharepoint.com/sites/test -Interactive
$page = Get-PnPPage "test.aspx"
$date = get-date
$date = $date.AddDays(1)
$page.SchedulePublish($date)
https://test.sharepoint.com/sites/test/_api/sitepages/pages(6171)/schedulepublish
Note: 6171 is the page item Id, which can be found in Site Pages library.
Moreover, please note that the above REST call works if the page item has values in OData__ScheduledVersion and OData__PublishStartDate.