PowerShell Commands
WSP (Windows Solution Package) Deployment steps:
- Add Solution
- Add-SPSolution WSP_File_Path
- Install Solution
- Install-SPSolution -Identity WSP_Name -WebApplication Web_App_URL -GACDepyment
- Update Solution
- Update-SPSolution -Identity WSP_Name -LiterelPath WSP_File_Path
- Uninstall Solution
- Uninstall-SPSolution -Identity WSP_Name -WebApplication Web_App_URL
- Remove Solution
- Remove-SPSolution -Identity WSP_Name
- Add-SPSolution c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp
- Install-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010 -GACDeployment
- Update-SPSolution –Identity SharePointProject2.wsp –LiteralPath c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp –GACDeployment
- Uninstall-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010
- Remove-SPSolution –Identity SharePointProject2.wsp
Site BackUp and Restore
BackUp
To take the backup use the below commands
- Backup-SPSite Site_URL -Path Location_And_name_Of_Bacup_File
- Get-SPSiteAdministration Site_URL | Backup-SPSite -Path Location_And_name_Of_Bacup_File
- Backup-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak
- Get-SPSiteAdministration http://server_name/sites/site_name | Backup-SPSite -Path C:\Backup\site_name.bak
Restore
To do restore use the below commands
- Restore-SPSite Site_URL -Path Bacup_File_Path
- Restore-SPSite Site_URL -Path Bacup_File_Path -Force -DatabaseServer SQLServ1 -DatabaseName SQLBD1
- Restore-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak
- Restore-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak -Force -DatabaseServer SQLBE1 -DatabaseName SQLDB1
Attach an existing content database to the farm in SharePoint
- Mount-SPContentDatabase "MYDatabse" -DatabseServer "MyServer" -WebApplication WebApp_URL
- Mount-SPContentDatabase "MYDatabse" -DatabseServer "MyServer" -WebApplication http://sitename
Add a DLL to the GAC using PoweShell
- Run the SharePoint PowerShell console as Administrator
- Enter the following PowerShell
- Set-location "c:\temp" [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") $publish = New-Object System.EnterpriseServices.Internal.Publish $publish.GacInstall("c:\temp\RemoveMicrosoftOfficeProtocolDiscoveryLoginBoxModule.dll") Iisreset
- To add an element in web.config
- You can just add the following line as the first httpModule inside
after the element in web.config: - <add name="RemoveMicrosoftOfficeProtocolDiscoveryLoginBoxModule" type="TheBlackKnightSings.RemoveMicrosoftOfficeProtocolDiscoveryLoginBoxModule, RemoveMicrosoftOfficeProtocolDiscoveryLoginBoxModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1537c6b9f16ad88e" />
No comments:
Post a Comment