Posts

Showing posts with the label SharePoint

Modern page provisioning using page template

Image
In this article let's see how to dynamically provision a modern page based on a modern page template and update its webpart properties using pnp/js in SPFx React webpart. Create a modern page template Create a page and add the webpart as per your requirements, finally save it as a template. it will be stored under the  "Templates" folder in SitePages. In the below example I have as Section=>3 Colum layout=>3 webparts. Create a page provision form component public   render ():  React . ReactElement < IDynamicPageCreaterProps > {      let   thisHandler  =  this ;      return  (        < div >          < h1 > { this . props . webpartName } </ h1 >           {           ( this . props . selectedTemplate  !=  undefined )...

Enable/Disable SharePoint OOTB SPAlerts using PowerShell

Image
SPAlerts aka User Alerts is one of nice feature that SharePoint provides OOTB, This feature get automatically enabled once we configure SMTP Outbound mail address in Central Admin.  Basically it has 3 types of Alerts Frequency: Immediate Daily Weekly  Each runs on it own respective TimerJob in CA.User can set alerts for both List/Library level or item level for any existing and newly created SPList/Lib objects.  However, There is no UI option available in SharePoint to enable/disable this feature per User/List/Library level; Without deleting  it. But some time our requirements are never been interesting that we need to disable alerts for Specific User or All the users from specific List/Library $oWeb = Get-SPWeb "https://site.domain.com/sites/web" $oList = $oWeb .Lists.TryGetList( "Communication" ) # Get all alert # $alerts = $oWeb.Alerts | ? { ($_.List.Title -eq $oList.Title) } # Get alerts of specific frequency $alerts = $oWeb .Aler...