Comments? Questions?

Have a look at my GitHub SharePointOnline-ScriptSamples, where you can find this SharePoint script and 280 others!

You can find all my repositories at PowershellScripts @ GitHub


The script is part of the explanation on editing the content types available in the article here:

SharePoint Online content types in Powershell: Edit.

This example gets the custom displayFormUrl of the content types belonging to one list.


As per definition the property gets or sets a value that specifies the URL of a custom display form to use for list items that have been assigned the content type. That means that trying to retrieve the url of a default form does not give us any results.




In order to use the script you need SharePoint Online SDK installed. Before running the script modify the following lines to refer to the SDK libraries installed on your computer and the content type data:



  # Paths to SDK. Please verify location on your computer. 
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"  
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"  
# Insert the credentials and the name of the admin site 
$AdminPassword=Read-Host -Prompt "Password" -AsSecureString