Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

SharePoint 2010 useful Powershell commands

$
0
0

Export Operation in SharePoint2010 using Powershell:
==========================================================

Export-SPWeb -Identity <SiteURL> -Path <Path and File Name> [-ItemUrl <URL of Site, List, or Library>] [-IncludeUserSecurity] [-IncludeVersions]
[-NoFileCompression] [-GradualDelete] [-Verbose]

Ex: Export-SPWeb http://Server1:5000/sites/Sc1 -ItemUrl "Lists/list1" -Path E:\Sc1\list1.cmp


Import Operation SharePoint2010 using Powershell:

Import-SPWeb -Identity  <SiteURL>  -Path <ExportFileName>  [-Force] [-NoFileCompression] [-Verbose]

EX:Import-SPWeb -Identity http://Server1:5000/sites/Sc1/ -path "\\server1\sc1\list1.cmp" -IncludeUserSecurity

======================================================================================


WSP BackUp(Power Shell) in SharePoint2010 using Powershell

(Get-SPSolution Infosys.Dew.Deployment.wsp).Solutionfile.Saveas("E:\Backup\web.site.Deployment.wsp_03092012")

=======================================================================================

Merge URL Logs from more than one server using power Shell command:

Merge-SPLogFile –Path "E:\Logs\MergedLog.log" –Overwrite –StartTime "1/3/2013 14:25" –EndTime "1/3/2013 14:40

==========================================================================================
Create Site Collection in SharePoint2010 using Powershell:

STSADM.EXE -o createsite -url http://Server1:5000/sites/Sc1/ -ownerlogin domain\yogesh -owneremailyogesh@test.com

New-SPSite -Url "http://Server1:5000/sites/Sc1/" -OwnerAlias "domain\yogesh" -OwnerEmail "yogesh@test.com"

---Retruns the sitecollection URL

=======================================================================================

Create Content Database in SharePoint2010 using Powershell : use farmadmin account

New-SPContentDatabase -Name WSS_Content_sc1 -WebApplication "http://Server1:5000/"

Returns :
Id               : c418cee5-5042-4a07-8217-eda7a0d9df43
Name             : WSS_Content_sc1
WebApplication   : SPWebApplication Name=sc1
Server           : server1
CurrentSiteCount : 0
========================================================================================

The Install-SPWebPartPack cmdlet installs the Web Part package, at the LiteralPath parameter location, in the local farm. The Web Part package can be installed in a specific Web application by using the WebApplication parameter. If a Web application is not specified, the Web Part package is installed in all Web applications

EX:

Install-SPWebPartPack "MyCustomWebPartPack" -LiteralPath "c:/mywebpart.wpp" -GlobalInstall

Uninstall-SPWebPartPack  "mypart.wpp" –WebApplication http://portal
This example uninstalls mypart.wpp to from the Web application http://portal

Get-SPWebPartPack –WebApplication http://portal | Uninstall-SPWebPartPack
This example uninstalls all Web part packages from the Web application http://portal.

========================================================================================


Backup and restore

Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential} -Item <WebApplicationName> [-Verbose]

========================================================================================


Move:

Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase <DestinationContentDb>

will let you the database of site collection for orphened sc's

==============================================================================================

Mount-SPContentDatabase “MyDatabase” -DatabaseServer "MyServer" -WebApplicationhttp://sitename

Mount-SPContentDatabase -name <NewContentDatabase> -DatabaseServer <DatabaseServer> -WebApplication <WebappUrl> -confirm:$false


YOGESHA H P(MCTS)


YOGESHA H P(MCTS)


Viewing all articles
Browse latest Browse all 13778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>