Managing sites Using PowerShell cmdlets in SharePoint 2010

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 Mar 06 2012, 06:00 AM by sos

Comments

Managing sites Using PowerShell cmdlets in SharePoint 2010 | Mastering Sharepoint wrote Managing sites Using PowerShell cmdlets in SharePoint 2010 | Mastering Sharepoint
on 03-11-2012 10:31 AM

Pingback from  Managing sites Using PowerShell cmdlets in SharePoint 2010 | 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.