SlideShare a Scribd company logo
Getting Started with PowerShell for
SharePoint 2010 administrators
Ravikanth Chaganti
About me
• A lead engineer at Dell and a Windows PowerShell
MVP
• Developer of
– PSCodePlex
– PSRemoteFileExplorer
– Remote File Explorer PowerPack
– BITS File Transfer PowerPack
– PSSPUtils – PS SharePoint 2010 Utils on Codeplex
• Author of
– Free eBook - Layman’s guide to PowerShell 2.0 remoting
– SharePoint 2010 PowerShell Cheat sheet (powerGui.org)
– Several others in pipe
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Agenda
• Part 1: Introduction to PowerShell
• Part 2: Introduction to PowerShell for
SharePoint 2010
• Q & A
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Why PowerShell?
• Understand with an example:
– Calculate the size of a folder
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
DOS Batch PowerShell
@echo off
setLocal EnableDelayedExpansion
set /a value=0
set /a sum=0
FOR /R %1 %%I IN (*) DO (
set /a value=%%~zI/1024
set /a sum=!sum!+!value!
)
@echo Size is: !sum! k
$size=0;gci C:scripts -rec | % {
$Size+=$_.Length};$size/1KB
PowerShell Console
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
PowerShell ISE
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Tab Completion
Extensible object model
Built-in debugger
Color coded syntax
PowerShell Cmdlets
 Pronounced as command-let
 A lightweight command
 an instance of .NET framework classes
 Use verb-noun pairs
◦ Get-Verb to list all approved verbs
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Discover PowerShell
• Master these cmdlets
– Get-Command
– Get-Help
– Get-Member
• About_Topics; example:
– Get-Help about_variables
– Get-Help about_Operators
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
PowerShell for SharePoint
• Replaces STSADM for command-line
management
– STSADM still ships for backward compatibility
• 500+ PowerShell cmdlets
– Programs -> Microsoft SharePoint 2010 Products
-> SharePoint 2010 management Shell
– Add-PSSnapin Microsoft.SharePoint.PowerShell
• Cmdlets have SP noun prefix
– Get-Command –Noun SP*
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
PowerShell can do more
• More than what central administration can do
• Examples
– Backup using SQL snapshots
– Configuring RBS
– Configuring request throttling
– Several others
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Things to know: Permissions
• Must have SharePoint_Shell_Access role on
SharePoint databases (both content &
configuration)
• Must be a member of WSS_ADMIN_WPG local
group on all farm servers
• Use Add-SPShellAdmin to give a user above
permissions
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Things to know: Object Disposal
• Some cmdlets return huge objects and take up
large amount of memory
• Objects get disposed at the end of pipeline
– Not true for objects stored in a variable
• Use a built-in cmdlet as far as possible
– Get-SPWeb –Identity http://sp2010demo | Set-SPWeb –Description “This is my demo site”
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Things to know: Object Disposal
• Use Dispose() when not using built-in cmdlets
• SharePoint 2010 provides cmdlets to
workaround this
– Start-SpAssignment
– Stop-SPAssignment
– Objects get associated to an assignment store and
get disposed when Stop-Assignment is called
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Things to know: Execution Policy
• By default, PowerShell does not allow scripts to run
• Change policy with Set-ExecutionPoilicy
• Policy Settings
– Restricted (default) – scripts will not execute
– Unrestricted – scripts can execute. Unsigned scripts will
prompt user to execute
– Bypass (developer mode) – scripts can execute, no user
prompting to execute
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
• PowerShell Console
• PowerShell ISE
• PowerGUI AdminConsole
• PowerGUI ScriptEditor
• PowerWF
• PowerShell Plus
Tools for the job
Books & Resources
• PowerShell for Microsoft SharePoint 2010
Administrators – By Niklas Goude & Mattias Karlsson
• SharePoint 2010 PowerShell cmdlets cheat sheet –
PowerGUI.Org
• PowerShell in action, 2nd edition – Bruce Payette
• Windows management framework (PowerShell v2)
download for Windows Server 2008, Vista, XP and
Windows 2003
– http://support.microsoft.com/kb/968929
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
Q & A
http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth

More Related Content

What's hot

Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
Taylor Lovett
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
Ryan Dennis
 
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP
Taylor Lovett
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
Marko Heijnen
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
Warren Zhou
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
Taylor Lovett
 
Fluxible
FluxibleFluxible
Fluxible
Taylor Lovett
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
Ido Flatow
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
Rami Sayar
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
Ido Flatow
 
Intro to Coldfusion
Intro to ColdfusionIntro to Coldfusion
Intro to Coldfusion
Terry Ryan
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
 
Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015
Andrew Krug
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
Peter Sankauskas
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
David Brattoli
 
Multi tenant CMSes using php
Multi tenant CMSes using phpMulti tenant CMSes using php
Multi tenant CMSes using php
kae-verens
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIFilip W
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
Stacy London
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 

What's hot (20)

Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
 
Isomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWPIsomorphic WordPress Applications with NodeifyWP
Isomorphic WordPress Applications with NodeifyWP
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Fluxible
FluxibleFluxible
Fluxible
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
 
Intro to Coldfusion
Intro to ColdfusionIntro to Coldfusion
Intro to Coldfusion
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015Selenium Tips & Tricks - StarWest 2015
Selenium Tips & Tricks - StarWest 2015
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
 
Multi tenant CMSes using php
Multi tenant CMSes using phpMulti tenant CMSes using php
Multi tenant CMSes using php
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web API
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 

Similar to PowerShell for sharepoint 2010 administrators

Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
Ryan Dennis
 
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
Jonathan Ralton
 
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer HarbarI6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
SPS Paris
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365
Michael Greene
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellSharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellSharePoint Saturday NY
 
Share point development 101
Share point development 101Share point development 101
Share point development 101
Becky Bertram
 
pandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fastpandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fast
Uwe Korn
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
Jonathan Ralton
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
garrett honeycutt
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
Kirk Madera
 
Microsoft SharePoint in the Workplace
Microsoft SharePoint in the WorkplaceMicrosoft SharePoint in the Workplace
Microsoft SharePoint in the Workplace
CTE Solutions Inc.
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Thomas Daly
 
SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)
MJ Ferdous
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksGuillermo Caicedo
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and Servers
Greg McMurray
 
Power shell
Power shellPower shell
Power shell
Rajkiran Swain
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones
 

Similar to PowerShell for sharepoint 2010 administrators (20)

Spsatx slides (widescreen)
Spsatx slides (widescreen)Spsatx slides (widescreen)
Spsatx slides (widescreen)
 
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNYC17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer HarbarI6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
I6 - State of the art SharePoint PowerShell Nation 2017 - Spencer Harbar
 
PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365PowerShell Introduction to Administering SharePoint On-Premises & O365
PowerShell Introduction to Administering SharePoint On-Premises & O365
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Share point development 101
Share point development 101Share point development 101
Share point development 101
 
pandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fastpandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fast
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Admin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShellAdmin SharePoint 2010 with PowerShell
Admin SharePoint 2010 with PowerShell
 
Microsoft SharePoint in the Workplace
Microsoft SharePoint in the WorkplaceMicrosoft SharePoint in the Workplace
Microsoft SharePoint in the Workplace
 
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UICross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
Cross Site Collection Navigation with SPFX, PowerShell PnP, PnP-JS, Office UI
 
SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)SharePoint Fundamentals (Lesson 1&2)
SharePoint Fundamentals (Lesson 1&2)
 
SQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & TricksSQL Server Integration Services Tips & Tricks
SQL Server Integration Services Tips & Tricks
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and Servers
 
Power shell
Power shellPower shell
Power shell
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
 

More from Ravikanth Chaganti

Azure Bicep - An Introduction
Azure Bicep - An IntroductionAzure Bicep - An Introduction
Azure Bicep - An Introduction
Ravikanth Chaganti
 
Azure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and TricksAzure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and Tricks
Ravikanth Chaganti
 
Tests Driven PowerShell Learning
Tests Driven PowerShell LearningTests Driven PowerShell Learning
Tests Driven PowerShell Learning
Ravikanth Chaganti
 
PowerShell Data as File System
PowerShell Data as File SystemPowerShell Data as File System
PowerShell Data as File System
Ravikanth Chaganti
 
Azure at the command line
Azure at the command lineAzure at the command line
Azure at the command line
Ravikanth Chaganti
 
Microsoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOpsMicrosoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOps
Ravikanth Chaganti
 
Using PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormationUsing PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormation
Ravikanth Chaganti
 
Developing Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CDDeveloping Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CD
Ravikanth Chaganti
 
PowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node SynchronizationPowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node Synchronization
Ravikanth Chaganti
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016
Ravikanth Chaganti
 
Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015
Ravikanth Chaganti
 
Cloud Computing for IT professionals
Cloud Computing for IT professionalsCloud Computing for IT professionals
Cloud Computing for IT professionals
Ravikanth Chaganti
 
Introduction to Microsoft Azure Compute
Introduction to Microsoft Azure ComputeIntroduction to Microsoft Azure Compute
Introduction to Microsoft Azure Compute
Ravikanth Chaganti
 
Cross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State ConfigurationCross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State Configuration
Ravikanth Chaganti
 
Windows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V ReplicaWindows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V Replica
Ravikanth Chaganti
 
Whats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-VWhats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-V
Ravikanth Chaganti
 
Configuration management comes to Windows
Configuration management comes to WindowsConfiguration management comes to Windows
Configuration management comes to Windows
Ravikanth Chaganti
 
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaRavikanth Chaganti
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanthRavikanth Chaganti
 
PowerShell 3.0 workflows
PowerShell 3.0 workflowsPowerShell 3.0 workflows
PowerShell 3.0 workflows
Ravikanth Chaganti
 

More from Ravikanth Chaganti (20)

Azure Bicep - An Introduction
Azure Bicep - An IntroductionAzure Bicep - An Introduction
Azure Bicep - An Introduction
 
Azure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and TricksAzure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and Tricks
 
Tests Driven PowerShell Learning
Tests Driven PowerShell LearningTests Driven PowerShell Learning
Tests Driven PowerShell Learning
 
PowerShell Data as File System
PowerShell Data as File SystemPowerShell Data as File System
PowerShell Data as File System
 
Azure at the command line
Azure at the command lineAzure at the command line
Azure at the command line
 
Microsoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOpsMicrosoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOps
 
Using PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormationUsing PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormation
 
Developing Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CDDeveloping Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CD
 
PowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node SynchronizationPowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node Synchronization
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016
 
Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015
 
Cloud Computing for IT professionals
Cloud Computing for IT professionalsCloud Computing for IT professionals
Cloud Computing for IT professionals
 
Introduction to Microsoft Azure Compute
Introduction to Microsoft Azure ComputeIntroduction to Microsoft Azure Compute
Introduction to Microsoft Azure Compute
 
Cross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State ConfigurationCross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State Configuration
 
Windows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V ReplicaWindows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V Replica
 
Whats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-VWhats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-V
 
Configuration management comes to Windows
Configuration management comes to WindowsConfiguration management comes to Windows
Configuration management comes to Windows
 
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
 
PowerShell 3.0 workflows
PowerShell 3.0 workflowsPowerShell 3.0 workflows
PowerShell 3.0 workflows
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 

PowerShell for sharepoint 2010 administrators

  • 1. Getting Started with PowerShell for SharePoint 2010 administrators Ravikanth Chaganti
  • 2. About me • A lead engineer at Dell and a Windows PowerShell MVP • Developer of – PSCodePlex – PSRemoteFileExplorer – Remote File Explorer PowerPack – BITS File Transfer PowerPack – PSSPUtils – PS SharePoint 2010 Utils on Codeplex • Author of – Free eBook - Layman’s guide to PowerShell 2.0 remoting – SharePoint 2010 PowerShell Cheat sheet (powerGui.org) – Several others in pipe http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 3. Agenda • Part 1: Introduction to PowerShell • Part 2: Introduction to PowerShell for SharePoint 2010 • Q & A http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 4. Why PowerShell? • Understand with an example: – Calculate the size of a folder http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth DOS Batch PowerShell @echo off setLocal EnableDelayedExpansion set /a value=0 set /a sum=0 FOR /R %1 %%I IN (*) DO ( set /a value=%%~zI/1024 set /a sum=!sum!+!value! ) @echo Size is: !sum! k $size=0;gci C:scripts -rec | % { $Size+=$_.Length};$size/1KB
  • 6. PowerShell ISE http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth Tab Completion Extensible object model Built-in debugger Color coded syntax
  • 7. PowerShell Cmdlets  Pronounced as command-let  A lightweight command  an instance of .NET framework classes  Use verb-noun pairs ◦ Get-Verb to list all approved verbs http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 8. Discover PowerShell • Master these cmdlets – Get-Command – Get-Help – Get-Member • About_Topics; example: – Get-Help about_variables – Get-Help about_Operators http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 9. PowerShell for SharePoint • Replaces STSADM for command-line management – STSADM still ships for backward compatibility • 500+ PowerShell cmdlets – Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 management Shell – Add-PSSnapin Microsoft.SharePoint.PowerShell • Cmdlets have SP noun prefix – Get-Command –Noun SP* http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 10. PowerShell can do more • More than what central administration can do • Examples – Backup using SQL snapshots – Configuring RBS – Configuring request throttling – Several others http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 11. Things to know: Permissions • Must have SharePoint_Shell_Access role on SharePoint databases (both content & configuration) • Must be a member of WSS_ADMIN_WPG local group on all farm servers • Use Add-SPShellAdmin to give a user above permissions http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 12. Things to know: Object Disposal • Some cmdlets return huge objects and take up large amount of memory • Objects get disposed at the end of pipeline – Not true for objects stored in a variable • Use a built-in cmdlet as far as possible – Get-SPWeb –Identity http://sp2010demo | Set-SPWeb –Description “This is my demo site” http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 13. Things to know: Object Disposal • Use Dispose() when not using built-in cmdlets • SharePoint 2010 provides cmdlets to workaround this – Start-SpAssignment – Stop-SPAssignment – Objects get associated to an assignment store and get disposed when Stop-Assignment is called http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 14. Things to know: Execution Policy • By default, PowerShell does not allow scripts to run • Change policy with Set-ExecutionPoilicy • Policy Settings – Restricted (default) – scripts will not execute – Unrestricted – scripts can execute. Unsigned scripts will prompt user to execute – Bypass (developer mode) – scripts can execute, no user prompting to execute http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 15. • PowerShell Console • PowerShell ISE • PowerGUI AdminConsole • PowerGUI ScriptEditor • PowerWF • PowerShell Plus Tools for the job
  • 16. Books & Resources • PowerShell for Microsoft SharePoint 2010 Administrators – By Niklas Goude & Mattias Karlsson • SharePoint 2010 PowerShell cmdlets cheat sheet – PowerGUI.Org • PowerShell in action, 2nd edition – Bruce Payette • Windows management framework (PowerShell v2) download for Windows Server 2008, Vista, XP and Windows 2003 – http://support.microsoft.com/kb/968929 http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth
  • 17. Q & A http://ravichaganti.com/blog Ravikanth@Ravichaganti.com @ravikanth