Quantcast
Viewing latest article 3
Browse Latest Browse All 16

Cannot locate content types

Hi Titifeleke,

Have your tried the PowerShell commands provide by KRISHANA KUMAR?

Using the SPContentTypeUsage (https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttypeusage.aspx), we can track where the content type is used. With the following commands (provided by KRISHANA KUMAR), we can use the report of where the specific content type is used.

$site = Get-SPSite("your site url");

foreach ($web in $site.AllWebs) {

   $ctype = $web.ContentTypes["Your Content Type"]

   $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype)

   foreach ($usage in $usages) {

      Write-Host $usage.Url

   }

}

If you want to get the report for all content types in the site collection, use the following PowerShell.

$site = Get-SPSite("your site collection url");

foreach ($web in $site.AllWebs) {

   foreach ($ctype in $web.ContentTypes) {

                $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype)

                foreach ($usage in $usages) {

               Write-Host $ctype.Name":"$usage.Url

                }

   }

}

Best regards,

Allen Bai


Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


Viewing latest article 3
Browse Latest Browse All 16

Trending Articles