
SharePoint 2010 Administration PowerShell Sheet
There are 652 SharePoint Server 2010 PowerShell cmdlets. Please find bellow a short list with the ones that I use.
Before starting please verify that you meet the following minimum requirements:
1. Your user account is a member of the SharePoint_Shell_Access role on the configuration database.
2. Your user account is a member of the WSS_ADMIN_WPG local group on the computer where SharePoint Server 2010 is installed.
Please open SharePoint Server 2010 Management Shell. To acomplish this please follow the steps:
1. On the Start menu, click All Programs.
2. Click Microsoft SharePoint Server 2010 Products.
3. Click SharePoint Server 2010 Management Shell.
Application Management
Web Applications
To create a new Web Application using PowerShell just use:
New-SPWebApplication -Name <Name> -ApplicationPool <ApplicationPool> -ApplicationPoolAccount <ApplicationPoolAccount> -Port <Port> -URL <URL>
Create a Site Collection
To create a new Site Collection using PowerShell first you have to chose a template. To do that just use the following command to list all the templates available within SharePoint:
Get-SPWebTemplate
Then replace <template-name> with your selected template and use the following command to create the site collection:
$template = Get-SPWebTemplate <template-name>
New-SPSite -Url <URL for the new site collection>-OwnerAlias <domain\user> -Template $template
Delete a Site Collection
To delete a site collection use the following command:
Remove-SPSite -Identity <URL of the site collection> –GradualDelete
Service Applications
To manage Service Applications from PowerShell you have the know the service’s guid. To see all the guid’s in the farm use:
Get-SPServiceInstance
Then, for starting / stoping a service use:
Start-SPServiceInstance -Identity <service guid>
Stop-SPServiceInstance -Identity <service guid>
Add a Content Database to a Web Application
New-SPContentDatabase -Name <content database name> -WebApplication <web application url>
Site Management
Backup SharePoint Site
Backup-SPSite <http://sharepoint-url> -path “<c:\…>”
Restore SharePoint Site
Restore-SPSite <http://sharepoint-url> -path “<c:\…>”
To be updated…
Tags: Backup-SPSite, Get-SPServiceInstance, Get-SPWebTemplate, New-SPContentDatabase, New-SPSite, New-SPWebApplication, Remove-SPSite, Restore-SPSite, sharepoint powershell, Start-SPServiceInstance, Stop-SPServiceInstance
Trackback from your site.