#Description:Find duplicate content types in sitecollection Add-PSSnapin microsoft.sharepoint.powershell $siteURL = "https://test-mysite.mycompany.com" $site = get-spsite $siteURL $object = @() foreach ($newWeb in $site.AllWebs) { foreach ($cType in $newWeb.contentTypes) { $tempObj = new-object PSObject -Property @{webURL=$newWeb.Url; CTName=$cType.Name; CTid=$cType.Id} $object += $tempObj } } #sort out duplicates $duplicates = $object |Group-Object ctid |Where-Object {$_.count -gt 1} |select -ExpandProperty group write-output "Found $($object.count) content types in $siteURL" write-output "Total duplicates: $($duplicates.count)" $duplicates
Reflections over the current computer issues from an struggling network technician
Monday, July 18, 2016
Finding duplicate content types
Got to a chance to build a script for finding content type duplicates in a Site Collection
Subscribe to:
Post Comments (Atom)
Powershell and Uptimerobot
Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...
-
Problem: In a customer environment they wanted to install RDS and DC on the same server. A nice cheap solution, which have worked perfectly...
-
Error received for no apparent reason when creating workflow. Errors were found when compiling the workflow. The workflow files were save ...
-
I had some problems with the old familiar "Working on it" for mysites in Sharepoint 2019. It was difficult to find information ab...
No comments:
Post a Comment