Find Where Content Type Is In Use

FindWhereContentTypeIsInUse.ps1

# Find Where Content Type is In Use
# M. Cox 1/3/2013
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"
$sitename= "http://bmpub.int"
$contentType = "Project Document"

$web = Get-SPWeb $sitename
$ct = $web.AvailableContentTypes[$contentType]
$ctusage = [Microsoft.SharePoint.SPContentTypeUsage]::GetUsages($ct)
    foreach ($ctuse in $ctusage) {
        write-host "Content Type" $contentType " is in use at " $ctuse.Url
    }
   
$web.Dispose()

No comments:

Post a Comment