skaggej
skaggej
Reputation Top 1%
Eric Skaggs
7 Snippets  (129th place)
Published
1 Channel
Created
0 Channels
Following
160 points  (189th place)
Reputation
Junior Code Generator
Serious Code Generator
Junior Publisher
Serious Publisher
Junior Topic Creator
Junior Judge
Junior Popular Coder
Serious Popular Coder
Junior Autobiographer
Serious Autobiographer
Senior Autobiographer
Master Autobiographer
Junior Famous Coder
Junior Wise Coder
Serious Popular Coder

Recent Snippets See all snippets by skaggej

public by skaggej  4560  6  6  1

SharePoint 2010 - Delete All Content Types in a Specific Content Type Group

This script will delete all content types within the specific content type group for the specified site collection. Prior to running this script, you must be sure that your content types are not being referenced anywhere.
$url = "http://www.sharepointnerd.com"  <# Replace this URL with your own. #>
$site = get-spsite $url
$rootWeb = $site.OpenWeb()
$myContentTypes = $rootWeb.ContentTypes | Where-Object{$_.Group -eq "SharePointNerd Content Types"} <# Replace this content type group with your own. #>
$myContentTypes | foreach-object{$_.Delete()}
;

public by skaggej  2712  1  6  0

SharePoint 2010 - Export Farm Solutions

This is especially useful when you want to be sure that you have a backup of the current solution packages before you overwrite them with updated ones. I run this before every production deployment to ensure that I have a way to revert back to the old "version" of my solutions.
$path = "C:\downloads\Exported Solution Packages"
(Get-SPFarm).Solutions | ForEach-Object{$var = $path + "\" + $_.Name; $_.SolutionFile.SaveAs($var)}
;

public by skaggej  237899  1  6  0

SharePoint 2010 - Bulk Upload Solution Packages

When migrating a SharePoint environment from 2007 to 2010, don't forget about your solution packages! You can extract them from the SharePoint 2007 Solution Store, then use this script to upload them all to SharePoint 2010 in seconds!
$solutions = Get-ChildItem -Path "C:\downloads\Exported Solution Packages"
$solutions | ForEach-Object {add-spsolution -literalpath "C:\Exported Solution Packages\$_"}
;

public by skaggej  230822  1  6  0

SharePoint 2010 - View Resource Measures for Sandboxed Solutions

Ever wonder exactly what "300 points" means for you sandboxed solutions' resource quota in SharePoint 2010? Run the following PowerShell script in the SharePoint 2010 Management Shell and you'll be able to see it for yourself.
$resourceMeasures = [Microsoft.SharePoint.Administration.SPUserCodeService]::Local.ResourceMeasures
$resourceMeasures | Select Name, ResourcesPerPoint
;

public by skaggej  336496  3  6  0

SharePoint 2010 - Disable the "New" icon for newly added content

This is another easy and useful one; I find it helpful when I'm recording content and adding it as I'm going. I don't really want the word "New" next to some things and not next to others. The finalized recordings look better if that's never there. Here's the simple PowerShell script that you can run per web application to disable the "New" icon
$webApp = Get-SPWebApplication http://sharepoint2010
$webApp.DaysToShowNewIndicator = "0"
$webApp.Update()
;