I am using the CSOM for PowerShell to get all the default forms(new/display/edit) used by the list in SharePoint online site. Below is the code snippet for the same.

$NewFormUrl = $List.DefaultNewFormUrl
$DisplayFormUrl = $List.DefaultDisplayFormUrl
$EditFormUrl = $List.DefaultEditFormUrl

These values are returned as blank for any lists inside the site. I am able to fetch other list properties except these three property values.

How can I get the default forms?

2 Answers 2


@Adam has provided a good method, and you can take a referecne of below csom powerhsell script:

Add-Type -Path 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll'

#Mysite URL
$site = 'https://abc.sharepoint.com/sites/sbdev'

#Admin User Principal Name
$admin = '[email protected]'

#Get Password as secure String
$password = ConvertTo-SecureString "xxxxxx" -AsPlainText -Force

#Get the Client Context and Bind the Site Collection
$context = New-Object Microsoft.SharePoint.Client.ClientContext($site)

$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin , $password)
$context.Credentials = $credentials

$list = $context.Web.Lists.GetByTitle('mm')

[string[]]$props = @("DefaultNewFormUrl","DefaultDisplayFormUrl","DefaultEditFormUrl")




enter image description here


Not sure if below code meet the requirement,

#Get all forms

# check CustomizedPageStatus
$f_form= $list.RootFolder.Files.GetByUrl($list.DefaultDisplayFormUrl)


got some tips from:

  • Thanks Adam! Can you tell me one thing, how to identify whether the form is a default out of the box form or a customized one? Commented Aug 31, 2020 at 6:02

You need to include them in the context query so they will be initialized. By default not all properties of and object are initialized. I don't quite remember how to do include in plain PowerShell CSOM (I think it was not that easy).

For SharePoint Online I would suggest you to use PnP PowerShell which makes many things very easy, and always if something is still not available you may then use plain CSOM approach on the context.

So with PnP PowerShell you could do it like this:

Connect-PnPOnline -Url "YourSiteUrl"
$list = Get-PnPList -Identity "YourListName" -Includes DefaultDisplayFormUrl, DefaultEditFormUrl, DefaultNewFormUrl

I tested this and the result is present below enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.