How to Create a Calendar List in Modern SharePoint Online Site?

Requirement: Create a calendar list in SharePoint Online.

How to create a calendar in SharePoint Online?

SharePoint Online calendar list provides a convenient and visual way to organize meetings and events. You can display calendar lists in daily, weekly, and monthly views. Adding a calendar to a SharePoint Online modern site is a bit tricky, as it’s moved under “Classic Apps”. To create a calendar list in SharePoint Online, follow these steps:

  1. Login to your SharePoint Online modern site >> Click on the “New” toolbar >> Choose “App”.how to create calendar list sharepoint online
  2. On the SharePoint Apps page, click on the “Classic Experience” link. This will take you to the classic apps page. (URL shortcut: https://YourDomain.sharepoint.com/sites/Your-Site/_layouts/15/addanapp.aspx).sharepoint online create calendar app
  3. Scroll down (or search) and pick the “Calendar” app.create calendar sharepoint online
  4. Enter the name for your calendar and click on “Create”.add calendar in sharepoint online

Now, you have a calendar list created on the SharePoint Online modern site.

SharePoint Online: PowerShell to Create a Calendar

Let’s create a calendar in SharePoint Online using PnP PowerShell:

#Parameters
$SiteURL = "https://crescent.sharepoint.com"
$CalendarName = "Firm Events" 

Try { 
    #Connect to PnP Online
    Connect-PnPOnline -Url $SiteURL -Interactive
 
    #Get the File
    $Calenar = New-PnPList -Title $CalendarName -Template Events -ErrorAction Stop
    Write-host "Calendar List Added to the Site!" -f Green
    }
Catch {
    write-host -f Red "`tError:" $_.Exception.Message
}

Create Calendar List in SharePoint Online using PowerShell CSOM

Here is the CSOM way to add a new calendar list in SharePoint Online:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Parameters
$SiteURL = "https://Crescent.sharepoint.com/sites/Events"
$CalendarName = "Firm Events"

Try {
    #Get Credentials to connect
    $Cred = Get-Credential
 
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)

    #Create a Calendar
    $ListInfo = New-Object Microsoft.SharePoint.Client.ListCreationInformation
    $ListInfo.Title = $CalendarName
    $ListInfo.TemplateType = 106
    $List = $Ctx.web.Lists.Add($ListInfo)
    $List.Description = $ListTitle
    $List.Update()
    $Ctx.ExecuteQuery()

    Write-host "Calendar List Added to the Site!" -f Green
}
Catch {
    write-host -f Red "`tError:" $_.Exception.Message
}

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

2 thoughts on “How to Create a Calendar List in Modern SharePoint Online Site?

  • So there’s no way to add a calendar without using PowerShell?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *