SlideShare a Scribd company logo
MONITORING AND MAINTAINING SHAREPOINT
SERVER
Course: SharePoint 2013 for Administrators and IT Pro's | Akrura Technologies
By : Isha Kapoor
SharePoint MVP, Author, Trainer and Founder
http://www.akruratechnologies.com/
http://www.learningsharepoint.com/ | @LearningSP
SharePoint
OUTLINE…
• Introduction to STSADM
• Adding Solutions, Features using STSADM
• BackupRestore and ImportExport using STSADM
• Introduction to Windows PowerShell
• Installing Solution packages (WSPs) using Windows PowerShell
• Advanced reporting and Analysis using Windows PowerShell
• BackupRestore, ImportExport SharePoint sites using Windows PowerShell
• Configure diagnostic logging in SharePoint 2013
• Developer Dashboard in SharePoint 2013
INTRODUCTION TO STSADM
What is STSADM?
All SharePoint Servers includes Stsadm tool for command-line administration of Office SharePoint Server
servers and its sites.
Stsadm is located at the following path on the drive where SharePoint & Products is installed:
%COMMONPROGRAMFILES%microsoft sharedweb server extensions12bin
What permissions are needed to use STSADM?
You must be an administrator on the local computer to use Stsadm. It is recommended to run STSADM with
Farm account to get full access to the commands. The tool STSADM must be run on the server itself.
STSADM Commands are made up of two parts
• Operation – These are SharePoint Operations that you will use to administrator siteslistslibraries,
permissions etc.
• Parameters – These are switches that can be used with Stsadm Operations.
Syntax :
-operation OperationName -parameter value
What are SharePoint Solution Packages?
Any component that you want to Install in a SharePoint server must be added as a Solution Package or a WSP package (that
has an extension .wsp). A Solution package is generally made up of a set of files that defines the components being installed on
the server. For example, a typical solution package can be for deploying a Custom WebPart, a Feature, a Custom Action etc.
A Solution package is a Single file but site admins can view Individual files in a .wsp by making a copy of it and renaming it as a
.cab extension.
Solution Store – Every SharePoint Farm has a Solution Store (also known as Solutions or Farm Solutions) where all the
Solution packages or WSPs are installed. You can find the Solution Store in Central Admin under Operations.
Adding a Solution - Adding a Solution is done in two parts : Installing and Deploying.
Installing Solution - Installing a Solution means adding it in a Solutions store on the farm. An STSADM Command addsolution is
generally used to add a Solution into a Solution store.
stsadm -o addsolution -filename <solution file path>
Deploying Solution - Deploying a Solution means scoping a solutions to one or more Web applications. An STSADM Command
deploysolution is generally used to deploy a Solution to one or more Web applications.
stsadm -o deploysolution -name <solution name> -url <URL of Web application> [-allowgacdeployment]
ADDING SOLUTIONS, FEATURES USING STSADM
What are Features?
Every Solution package that deploys a component contains a Feature for that Component.
In simple words, A Feature defines the component and a solution package bundles up a feature and all the supporting files that
needs to be deployed.
Feature Scope - A feature can be scoped to the following
• Farm
• Web application
• Site Collection
• Site
Adding a Feature - Adding a Feature is done in two parts : Installing and Activating.
Installing Feature - Installing a Feature makes its definition and elements known throughout a server farm.
stsadm -o addsolution -filename <solution file path>
Farm-scoped features are also automatically activated during this stage.
Activating Feature - Activating the Feature makes the Feature available at a particular scope.
stsadm -o activatefeature {-filename <path to Feature.xml> | -name <feature folder> } -url <URL of Web applicationSite
Collection>
ADDING FEATURES USING STSADM
BACKUPRESTORE AND IMPORTEXPORT USING STSADM
BackupRestore - STSADM backuprestore are popular commands used for backup and restore of a SharePoint site collection or a Web
application.
Syntax :
stsadm -o backup -url <URL of Web application> -filename <backup file path extension .bak>
stsadm -o restore -url <URL of Web application> -filename <backup file path extension .bak>
Benefits -
• Moving a Site Collection from one Content database to another.
• With BackupRestore stsadm command all SharePoint Designer Workflows gets moved without any issues.
• Moving a Site Collection with BackupRestore stsadm command, the actual Content get moved. That means it leaves behind the heavy
Audit Logs, Workflow history list etc.
ImportExport - STSADM ImportExport Commands are generally used to move a Subsite or Web but it can also export a site collection, web
application or even a list.
Syntax :
stsadm -o export -url <URL of Web application> -filename <backup file path>
stsadm -o import -url <URL of Web application> -filename <backup file path>
STSADM BACKUP/RESTORE VS IMPORTEXPORT
Stsadm backup/restore Stsadm export/import
BackupRestore a Site Collection or a Web application. Exports data of a Subsite, site collection, an entire web
application, or a single list.
The GUID of all items in a Site Collection is preserved except the
GUID of the Site collection itself. When you restore the backup,
SharePoint generates a new GUID for the site collection.
It generates a new GUID for every objects such as sites, sub
sites, lists and items.
Because of the same Guid, you can restore in the same web
application or farm but in a different Content database.
Because of the new Guid, you can restore or import the data in
the same site collectionsite or web application and it does not
matter on which content database you run import operation.
This operation is designed to take an exact copy of a site collection,
no data will be changed, transformed or lost.
This operation is good for merging content of sites, and decide
how to handle identical data between source and target.
All workflows instances, associations, history and tasks are
preserved.
A major drawback of this operation is that it does not preserves
workflows instances, associations, history and tasks. Every
workflow association must be recreated and there is no way to
restore the running instances from original site.
INTRODUCTION TO WINDOWS POWERSHELL
What is Windows PowerShell?
“Windows PowerShell is a command-line scripting tool that provides an administrator full access to applicable application programming
interfaces (APIs). Administrators can use Windows PowerShell to interact directly with SharePoint-based web applications, site collections,
sites, lists, and more.
To run SharePoint Commands with PowerShell you need to add the below SharePoint Snap-In first.
Add-PSSnapin Microsoft.SharePoint.Powershell
What permissions are needed to use PowerShell?
A user must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG
local group on the computer where SharePoint is installed.
PowerShell Commands can be made up the following :
Get-Command - The Get-Command cmdlet gets commands in the session, such as aliases, functions, filters, scripts, and applications.
Get-Member - The Get-Member cmdlet gets the "members" (properties and methods) of objects.
Get-Help - The Get-Help cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, providers,
functions, aliases and scripts. To get a list of all cmdlet help topic titles, type get-help *
Pipelines - PowerShell uses Pipelines to filter commands and display the desired results. When you “pipe” an object from one part of a
command to another, you’re simply passing that object - unchanged - from one part of the command to another.
For Complete SharePoint 2013 PwerShell cmdlets list see : http://technet.microsoft.com/library/ff678226%28office.15%29.aspx
Examples of Get-Command
Get-SPWebApplication - The Get-SPWebApplication cmdlet returns all Web applications that match the scope given by the Identity
parameter. The Identity can be the name of the name, URL, or GUID of the Web application. If no Identity is specified, all Web applications are
returned.
Get-SPWebApplication -Identity <URL of Web application>
Get-SPSite - Returns all site collections that match the specified criteria.
Get-SPSite -Identity <URL of Site Collection>
* -Identity specifies the Name, URL, or GUID of the Item
* -Limit All displays all results instead of a limited items.
Example : To get all Site Collections of a Web Application.
Get-SPWebApplication <URL of Web application> | Get-SPSite -Limit All
Example : To get all SubSites in a all Site Collections of a Web Application.
Get-SPWebApplication <URL of Web application> | Get-SPSite -Limit All | Get-SPWeb -Limit All
If you have to get Subsites for a Specific Site Collection in a Web application, then use Where Object for a Command in a Pipe.
Get-SPWeb - Returns all Subsites in a Site collection that match the specified criteria.
Get-SPWeb -site <URL of Site Collection>
Examples of Pipelines
Select Pipeline : Lets you select the properties of an Object
Get-SPSite | select url, Title
Get-SPSite | get-member
Where-Object Pipeline :
Get-SPSite -Limit All | Where-Object {$_.Url -eq “<URL of Site Collection>”}
Get-SPSite -Limit All | Where-Object {$_.Url -like “* SiteColl”} | Get-SPWeb -Limit All | select url, Title
$sites = Get-SPSite | select url, Title | Where-Object {$_.Url -like "* SiteColl"}
foreach ($site in $sites) {
Write-Host $site
}
ForEach-Object Pipeline :
Get-SPSite -Limit All | ForEach-Object {$_.URL, ($_.Usage.Storage/1024/1024)}
Get-SPSite -Limit All | ForEach-Object {$_.URL, ($_.Quota.StorageMaximumLevel/1000000)}
Output Options -
| Out-string C:output.csv
| Out-GridView -Title “Window Name”
INSTALLING SOLUTION PACKAGES (WSPS) USING
WINDOWS POWERSHELL
Add-SPSolution - Uploads a SharePoint solution package to the farm.
Add-SPSolution -LiteralPath c:solution.wsp
Install-SPSolution - Deploys an installed SharePoint solution in the farm.
Install-SPSolution -Identity solution.wsp -GACDeployment -CompatibilityLevel {14,15}
ADVANCED REPORTING AND ANALYSIS USING WINDOWS
POWERSHELL
Examples -
Get all Sites where URL contains the word IT
$sites = Get-SPSite | Where-Object {$_.Url -like "*IT*"}
foreach ($site in $sites) {
Write-Host "Site is SPSite Url=$site"
To report usage and quota of your site collections:
Get-SPSite | Select URL, @{Name=”Storage”; Expression={“{0:N2} MB” -f($_.Usage.Storage/1000000)}},
@{Name=”Quota”; Expression={“{0:N2} MB” -f($_.Quota.StorageMaximumLevel/1000000)} } | Out-GridView -Title “Sites
with Usage”
WE ARE HERE TO
HELP.
Questions?

More Related Content

PPTX
Advanced SharePoint Server Concepts
PPTX
SharePoint Tools Concepts
DOCX
SharePoint 2013 for Administrators and IT Pro's
PPTX
Advanced SharePoint 2013 Site Administration
PPTX
SharePoint BCS, OK. But what is the SharePoint Business Data List Connector (...
PPTX
How to upgrade from SharePoint 2010 to SharePoint 2013 – a quick guide
PPTX
SharePoint 2010 Upgrade Drill Down
PPTX
Peter Ward: The True Power of SharePoint Designer Workflows
Advanced SharePoint Server Concepts
SharePoint Tools Concepts
SharePoint 2013 for Administrators and IT Pro's
Advanced SharePoint 2013 Site Administration
SharePoint BCS, OK. But what is the SharePoint Business Data List Connector (...
How to upgrade from SharePoint 2010 to SharePoint 2013 – a quick guide
SharePoint 2010 Upgrade Drill Down
Peter Ward: The True Power of SharePoint Designer Workflows

What's hot (20)

PPTX
SharePoint Programming Basic
PPTX
Migrating to SharePoint 2013 - Business and Technical Perspective
PPTX
SharePoint Performance: Best Practices from the Field
PPT
Back to the Basics: SharePoint Fundamentals by Joel Oleson
PPTX
SharePoint 2013 Performance Analysis - Robi Vončina
PDF
2014-02-22 - IT Pro Camp - SharePoint 2013, A Brief Overview of Capability
PDF
O365con14 - sharepoint 2013 and office 365 upgrade and migration
PPTX
SharePoint 2010 Upgrade Planning
PPTX
Hexa Corp Share Point Capabilities Presentation
PDF
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
PPTX
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
PPTX
SharePoint Connections Coast to Coast Overview of Enterprise Content Management
PPTX
SoCalCodeCamp SharePoint Server 2010 a Developer Platform
PPTX
Share point 2010_overview-day4-code
PPTX
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
PDF
MinRole and SharePoint 2016
PDF
Configure SharePoint Server 2013 in a Three-Tier Farm
PPTX
Analytically shiny and new: A guided tour of Microsoft’s Business Intelligenc...
PDF
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
PPTX
Plan, prepare & overall process of upgrade and migrate to SharePoint 2013
SharePoint Programming Basic
Migrating to SharePoint 2013 - Business and Technical Perspective
SharePoint Performance: Best Practices from the Field
Back to the Basics: SharePoint Fundamentals by Joel Oleson
SharePoint 2013 Performance Analysis - Robi Vončina
2014-02-22 - IT Pro Camp - SharePoint 2013, A Brief Overview of Capability
O365con14 - sharepoint 2013 and office 365 upgrade and migration
SharePoint 2010 Upgrade Planning
Hexa Corp Share Point Capabilities Presentation
Migrate SharePoint 2016 To SharePoint 2019 Environment Using Content Database...
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint Connections Coast to Coast Overview of Enterprise Content Management
SoCalCodeCamp SharePoint Server 2010 a Developer Platform
Share point 2010_overview-day4-code
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
MinRole and SharePoint 2016
Configure SharePoint Server 2013 in a Three-Tier Farm
Analytically shiny and new: A guided tour of Microsoft’s Business Intelligenc...
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
Plan, prepare & overall process of upgrade and migrate to SharePoint 2013
Ad

Similar to Monitoring and Maintaining SharePoint 2013 Server (20)

DOCX
Power shell
PPTX
Power Shell and Sharepoint 2013
PPTX
New World Of SharePoint 2010 Administration Oleson
PPTX
Intro to PowerShell
DOC
Persiapan UN by MGMP Fisika BPK PENABUR
PPT
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
PPTX
Using power shell to improve sharepoint management
PPTX
Getting Everything You want Out of SharePoint
PPTX
[Tech.Ed India 2011] Backup and Restore SharePoint 2010
PDF
Selecting And Protecting The Right Sharepoint Backup Targets Sps Michigan
PDF
Operacion Guinda 2
PPTX
NZ Code Camp 2011 PowerShell + SharePoint
PPTX
SPSDenver - Wrapping Your Head Around the SharePoint Beast
PPTX
SharePoint Development For Asp Net Developers
PPTX
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
KEY
Anatomy Of A Share Point Solution
PPTX
Making Life Easier with PowerShell (SPSVB 2012)
PPTX
Automating Enterprise Application Deployments with PowerShell
PPTX
Making Life Easier with PowerShell - SPSRIC
PPTX
Managing SharePoint Anywhere with Windows PowerShell
Power shell
Power Shell and Sharepoint 2013
New World Of SharePoint 2010 Administration Oleson
Intro to PowerShell
Persiapan UN by MGMP Fisika BPK PENABUR
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
Using power shell to improve sharepoint management
Getting Everything You want Out of SharePoint
[Tech.Ed India 2011] Backup and Restore SharePoint 2010
Selecting And Protecting The Right Sharepoint Backup Targets Sps Michigan
Operacion Guinda 2
NZ Code Camp 2011 PowerShell + SharePoint
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SharePoint Development For Asp Net Developers
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
Anatomy Of A Share Point Solution
Making Life Easier with PowerShell (SPSVB 2012)
Automating Enterprise Application Deployments with PowerShell
Making Life Easier with PowerShell - SPSRIC
Managing SharePoint Anywhere with Windows PowerShell
Ad

More from Learning SharePoint (16)

PPTX
Manage security in Model-app Power App with Common data service
DOCX
Microsoft 365 Audit Log Reports - M365 Learning Document
PPTX
Power Apps - Data governance, compliance and security
DOCX
Power BI Governance - Access Management, Recommendations and Best Practices
PPTX
Power Automate (MS Flow) basics, Behind the Scenes, Errors and Troubleshooting
DOCX
Office 365 Q & A about Microsoft Teams Access,OneDrive, O365 Groups, Shared C...
DOCX
Ms flow basics, troubleshooting and operational errors
PPTX
Onedrive for Business Implementation and Rollout
DOCX
Share point 2013 deployment document
PDF
SharePoint 2013 Site Administration Guide
PDF
OneDrive For Business - What's new for IT Administrators and End-users
PPTX
Hosting SharePoint 2016 farm in azure
PPT
Cloud holiday shopping guide
PPTX
SharePoint 2013 Site Administration
PPTX
Core SharePoint 2013 Concepts
PPTX
Manage security in Model-app Power App with Common data service
Microsoft 365 Audit Log Reports - M365 Learning Document
Power Apps - Data governance, compliance and security
Power BI Governance - Access Management, Recommendations and Best Practices
Power Automate (MS Flow) basics, Behind the Scenes, Errors and Troubleshooting
Office 365 Q & A about Microsoft Teams Access,OneDrive, O365 Groups, Shared C...
Ms flow basics, troubleshooting and operational errors
Onedrive for Business Implementation and Rollout
Share point 2013 deployment document
SharePoint 2013 Site Administration Guide
OneDrive For Business - What's new for IT Administrators and End-users
Hosting SharePoint 2016 farm in azure
Cloud holiday shopping guide
SharePoint 2013 Site Administration
Core SharePoint 2013 Concepts

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
A Presentation on Artificial Intelligence
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Digital-Transformation-Roadmap-for-Companies.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Monthly Chronicles - July 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding

Monitoring and Maintaining SharePoint 2013 Server

  • 1. MONITORING AND MAINTAINING SHAREPOINT SERVER Course: SharePoint 2013 for Administrators and IT Pro's | Akrura Technologies By : Isha Kapoor SharePoint MVP, Author, Trainer and Founder http://www.akruratechnologies.com/ http://www.learningsharepoint.com/ | @LearningSP SharePoint
  • 2. OUTLINE… • Introduction to STSADM • Adding Solutions, Features using STSADM • BackupRestore and ImportExport using STSADM • Introduction to Windows PowerShell • Installing Solution packages (WSPs) using Windows PowerShell • Advanced reporting and Analysis using Windows PowerShell • BackupRestore, ImportExport SharePoint sites using Windows PowerShell • Configure diagnostic logging in SharePoint 2013 • Developer Dashboard in SharePoint 2013
  • 3. INTRODUCTION TO STSADM What is STSADM? All SharePoint Servers includes Stsadm tool for command-line administration of Office SharePoint Server servers and its sites. Stsadm is located at the following path on the drive where SharePoint & Products is installed: %COMMONPROGRAMFILES%microsoft sharedweb server extensions12bin What permissions are needed to use STSADM? You must be an administrator on the local computer to use Stsadm. It is recommended to run STSADM with Farm account to get full access to the commands. The tool STSADM must be run on the server itself. STSADM Commands are made up of two parts • Operation – These are SharePoint Operations that you will use to administrator siteslistslibraries, permissions etc. • Parameters – These are switches that can be used with Stsadm Operations. Syntax : -operation OperationName -parameter value
  • 4. What are SharePoint Solution Packages? Any component that you want to Install in a SharePoint server must be added as a Solution Package or a WSP package (that has an extension .wsp). A Solution package is generally made up of a set of files that defines the components being installed on the server. For example, a typical solution package can be for deploying a Custom WebPart, a Feature, a Custom Action etc. A Solution package is a Single file but site admins can view Individual files in a .wsp by making a copy of it and renaming it as a .cab extension. Solution Store – Every SharePoint Farm has a Solution Store (also known as Solutions or Farm Solutions) where all the Solution packages or WSPs are installed. You can find the Solution Store in Central Admin under Operations. Adding a Solution - Adding a Solution is done in two parts : Installing and Deploying. Installing Solution - Installing a Solution means adding it in a Solutions store on the farm. An STSADM Command addsolution is generally used to add a Solution into a Solution store. stsadm -o addsolution -filename <solution file path> Deploying Solution - Deploying a Solution means scoping a solutions to one or more Web applications. An STSADM Command deploysolution is generally used to deploy a Solution to one or more Web applications. stsadm -o deploysolution -name <solution name> -url <URL of Web application> [-allowgacdeployment] ADDING SOLUTIONS, FEATURES USING STSADM
  • 5. What are Features? Every Solution package that deploys a component contains a Feature for that Component. In simple words, A Feature defines the component and a solution package bundles up a feature and all the supporting files that needs to be deployed. Feature Scope - A feature can be scoped to the following • Farm • Web application • Site Collection • Site Adding a Feature - Adding a Feature is done in two parts : Installing and Activating. Installing Feature - Installing a Feature makes its definition and elements known throughout a server farm. stsadm -o addsolution -filename <solution file path> Farm-scoped features are also automatically activated during this stage. Activating Feature - Activating the Feature makes the Feature available at a particular scope. stsadm -o activatefeature {-filename <path to Feature.xml> | -name <feature folder> } -url <URL of Web applicationSite Collection> ADDING FEATURES USING STSADM
  • 6. BACKUPRESTORE AND IMPORTEXPORT USING STSADM BackupRestore - STSADM backuprestore are popular commands used for backup and restore of a SharePoint site collection or a Web application. Syntax : stsadm -o backup -url <URL of Web application> -filename <backup file path extension .bak> stsadm -o restore -url <URL of Web application> -filename <backup file path extension .bak> Benefits - • Moving a Site Collection from one Content database to another. • With BackupRestore stsadm command all SharePoint Designer Workflows gets moved without any issues. • Moving a Site Collection with BackupRestore stsadm command, the actual Content get moved. That means it leaves behind the heavy Audit Logs, Workflow history list etc. ImportExport - STSADM ImportExport Commands are generally used to move a Subsite or Web but it can also export a site collection, web application or even a list. Syntax : stsadm -o export -url <URL of Web application> -filename <backup file path> stsadm -o import -url <URL of Web application> -filename <backup file path>
  • 7. STSADM BACKUP/RESTORE VS IMPORTEXPORT Stsadm backup/restore Stsadm export/import BackupRestore a Site Collection or a Web application. Exports data of a Subsite, site collection, an entire web application, or a single list. The GUID of all items in a Site Collection is preserved except the GUID of the Site collection itself. When you restore the backup, SharePoint generates a new GUID for the site collection. It generates a new GUID for every objects such as sites, sub sites, lists and items. Because of the same Guid, you can restore in the same web application or farm but in a different Content database. Because of the new Guid, you can restore or import the data in the same site collectionsite or web application and it does not matter on which content database you run import operation. This operation is designed to take an exact copy of a site collection, no data will be changed, transformed or lost. This operation is good for merging content of sites, and decide how to handle identical data between source and target. All workflows instances, associations, history and tasks are preserved. A major drawback of this operation is that it does not preserves workflows instances, associations, history and tasks. Every workflow association must be recreated and there is no way to restore the running instances from original site.
  • 8. INTRODUCTION TO WINDOWS POWERSHELL What is Windows PowerShell? “Windows PowerShell is a command-line scripting tool that provides an administrator full access to applicable application programming interfaces (APIs). Administrators can use Windows PowerShell to interact directly with SharePoint-based web applications, site collections, sites, lists, and more. To run SharePoint Commands with PowerShell you need to add the below SharePoint Snap-In first. Add-PSSnapin Microsoft.SharePoint.Powershell What permissions are needed to use PowerShell? A user must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint is installed. PowerShell Commands can be made up the following : Get-Command - The Get-Command cmdlet gets commands in the session, such as aliases, functions, filters, scripts, and applications. Get-Member - The Get-Member cmdlet gets the "members" (properties and methods) of objects. Get-Help - The Get-Help cmdlet displays information about Windows PowerShell concepts and commands, including cmdlets, providers, functions, aliases and scripts. To get a list of all cmdlet help topic titles, type get-help * Pipelines - PowerShell uses Pipelines to filter commands and display the desired results. When you “pipe” an object from one part of a command to another, you’re simply passing that object - unchanged - from one part of the command to another. For Complete SharePoint 2013 PwerShell cmdlets list see : http://technet.microsoft.com/library/ff678226%28office.15%29.aspx
  • 9. Examples of Get-Command Get-SPWebApplication - The Get-SPWebApplication cmdlet returns all Web applications that match the scope given by the Identity parameter. The Identity can be the name of the name, URL, or GUID of the Web application. If no Identity is specified, all Web applications are returned. Get-SPWebApplication -Identity <URL of Web application> Get-SPSite - Returns all site collections that match the specified criteria. Get-SPSite -Identity <URL of Site Collection> * -Identity specifies the Name, URL, or GUID of the Item * -Limit All displays all results instead of a limited items. Example : To get all Site Collections of a Web Application. Get-SPWebApplication <URL of Web application> | Get-SPSite -Limit All Example : To get all SubSites in a all Site Collections of a Web Application. Get-SPWebApplication <URL of Web application> | Get-SPSite -Limit All | Get-SPWeb -Limit All If you have to get Subsites for a Specific Site Collection in a Web application, then use Where Object for a Command in a Pipe. Get-SPWeb - Returns all Subsites in a Site collection that match the specified criteria. Get-SPWeb -site <URL of Site Collection>
  • 10. Examples of Pipelines Select Pipeline : Lets you select the properties of an Object Get-SPSite | select url, Title Get-SPSite | get-member Where-Object Pipeline : Get-SPSite -Limit All | Where-Object {$_.Url -eq “<URL of Site Collection>”} Get-SPSite -Limit All | Where-Object {$_.Url -like “* SiteColl”} | Get-SPWeb -Limit All | select url, Title $sites = Get-SPSite | select url, Title | Where-Object {$_.Url -like "* SiteColl"} foreach ($site in $sites) { Write-Host $site } ForEach-Object Pipeline : Get-SPSite -Limit All | ForEach-Object {$_.URL, ($_.Usage.Storage/1024/1024)} Get-SPSite -Limit All | ForEach-Object {$_.URL, ($_.Quota.StorageMaximumLevel/1000000)} Output Options - | Out-string C:output.csv | Out-GridView -Title “Window Name”
  • 11. INSTALLING SOLUTION PACKAGES (WSPS) USING WINDOWS POWERSHELL Add-SPSolution - Uploads a SharePoint solution package to the farm. Add-SPSolution -LiteralPath c:solution.wsp Install-SPSolution - Deploys an installed SharePoint solution in the farm. Install-SPSolution -Identity solution.wsp -GACDeployment -CompatibilityLevel {14,15}
  • 12. ADVANCED REPORTING AND ANALYSIS USING WINDOWS POWERSHELL Examples - Get all Sites where URL contains the word IT $sites = Get-SPSite | Where-Object {$_.Url -like "*IT*"} foreach ($site in $sites) { Write-Host "Site is SPSite Url=$site" To report usage and quota of your site collections: Get-SPSite | Select URL, @{Name=”Storage”; Expression={“{0:N2} MB” -f($_.Usage.Storage/1000000)}}, @{Name=”Quota”; Expression={“{0:N2} MB” -f($_.Quota.StorageMaximumLevel/1000000)} } | Out-GridView -Title “Sites with Usage”
  • 13. WE ARE HERE TO HELP. Questions?