Managing sites in SharePoint 2010 Using PowerShell cmdlets in SharePoint

In SharePoint 2010 you can manage sites through Windows PowerShell. You can create new sites in a site collection using the New-SPWeb cmdlet:

New-SPWeb http://SP/TeamSite -Template "STS#0" Name "Team Site" `
-Description "Description of Site" AddToTopNav UseParentTopNav

You can retrieve an existing site using the Get-SPWeb cmdlet:

Get-SPWeb http://SP/TeamSite

You can configure a site through the Set-SPWeb cmdlet:

Get-SPWeb http://SP/TeamSite | Set-SPWeb -Description "New Description"

And finally, you can remove a site using the Remove-SPWeb cmdlet:

Remove-SPWeb http://SP/TeamSite -Confirm:$false

Setting the –Confirm switch parameter to $false omits the confirmation returned from PowerShell.

Twitter This Tip! ReTweet this Tip!


Posted May 01 2012, 06:00 AM by sos

Comments

Managing sites in SharePoint 2010 Using PowerShell cmdlets | Mastering Sharepoint wrote Managing sites in SharePoint 2010 Using PowerShell cmdlets | Mastering Sharepoint
on 05-06-2012 5:22 PM

Pingback from  Managing sites in SharePoint 2010 Using PowerShell cmdlets | Mastering Sharepoint

Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.