question

Priyanshgupta-5126 avatar image
0 Votes"
Priyanshgupta-5126 asked IanXue-MSFT edited

I want to create PowerShell Script for SharePoint 2016 Content Type matching

I want to create PowerShell Script which matches Parent Content Type Name with Child Content Type Name for all the Site Collections of the Application in SharePoint 2016 and if Parent and Child Content Type Name is mismatched it prints out those content types.

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered IanXue-MSFT edited

Hi,

You may get started with this.

 (Get-SPWeb $site).ContentTypes | Where-Object { $_.Name -notmatch $_.Parent.Parent.Name}

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.