Automating SharePoint 2010 administration tasks with PowerShell
PowerShell for sharepoint 2010 administrators
17
Getting Started with PowerShell for SharePoint 2010 administrators Ravikanth Chaganti
-
Upload
ravikanth-chaganti -
Category
Technology
-
view
3.840 -
download
3
description
PowerShell for sharepoint 2010 administrators. This session was done at SharePoint Saturday India Online event
Transcript of 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 - Laymans guide to PowerShell 2.0 remoting
SharePoint 2010 PowerShell Cheat sheet (powerGui.org)
Several others in pipe
http://ravichaganti.com/blog
[email protected]
@ravikanth - 3. Agenda
Part 1: Introduction to PowerShell
Part 2: Introduction to PowerShell for SharePoint 2010
Q & A
http://ravichaganti.com/blog
[email protected]
@ravikanth - 4. Why PowerShell?
Understand with an example:
Calculate the size of a folder
http://ravichaganti.com/blog
[email protected]
@ravikanth - 5. PowerShell Console
http://ravichaganti.com/blog
[email protected]
@ravikanth
Tab completion
Console History - 6. PowerShell ISE
http://ravichaganti.com/blog
[email protected]
@ravikanth
Tab Completion
Extensible object model
Color coded syntax
Built-in debugger - 7. PowerShell Cmdlets
- Pronounced as command-let
- 8. A lightweight command
- 9. an instance of .NET framework classes
- 10. Use verb-noun pairs
- 11. Get-Verb to list all approved verbs
[email protected]
@ravikanth - 12. 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
[email protected]
@ravikanth - 13. 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
[email protected]
@ravikanth - 14. 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
[email protected]
@ravikanth - 15. 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
[email protected]
@ravikanth - 16. 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
[email protected]
@ravikanth - 17. 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
[email protected]
@ravikanth - 18. 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
[email protected]
@ravikanth - 19. PowerShell Console
PowerShell ISE
PowerGUI AdminConsole
PowerGUI ScriptEditor
PowerWF
PowerShell Plus
Tools for the job - 20. Books & Resources
PowerShell for Microsoft SharePoint 2010 Administrators By NiklasGoude& MattiasKarlsson
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
[email protected]
@ravikanth - 21. Q & A
http://ravichaganti.com/blog
[email protected]
@ravikanth