admin sharepoint 2010 with powershell

21
Administering SharePoint 2010 with Windows PowerShell Don Jones Concentrated Technology, LLC http://concentratedtech.com

Upload: concentrated-technology

Post on 15-Nov-2014

1.270 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Admin SharePoint 2010 with PowerShell

Administering SharePoint 2010with Windows PowerShell

Don JonesConcentrated Technology, LLC

http://concentratedtech.com

Page 2: Admin SharePoint 2010 with PowerShell

This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own

organization however you like.

For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web

site, www.ConcentratedTech.com.

For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg

This work is copyright ©Concentrated Technology, LLC

Page 3: Admin SharePoint 2010 with PowerShell

Agenda

• Our main goal is to explore what’s possible in SharePoint using Windows PowerShell…

• …and to start looking at the major command sets that accomplish administrative tasks

• We’ll spend a lot of time examining the Help files as part of this

Page 4: Admin SharePoint 2010 with PowerShell

CAUTION: DEMOS AHEAD

• This is a demonstration-intensive session (very few slides)

• I will capture a shell transcript and save all of my scripts

• You can download these (in a week or so) from ConcentratedTech.com (there’s a “Conference Materials” link in the menu)

Page 5: Admin SharePoint 2010 with PowerShell

SP Management Shell

• Not really an independent shell…• …just a “preloaded” Windows PowerShell• Loads a specific module/snapin at startup so

that SP commands are available• You could also manually load these into a

“normal” shell (or 3rd-party host)• Let’s see

Page 6: Admin SharePoint 2010 with PowerShell

Shell Admin Permissions

• Need to grant admins the right to use the management shell

• Get-SPShellAdmin• Add-SPShellAdmin –username DOMAIN\user

-database (Get-SPContentDatabase -Identity database_name)

• Remove-SPShellAdmin

Page 7: Admin SharePoint 2010 with PowerShell

Cmdlet Naming

• Notice the SP prefix on the noun of all SharePoint cmdlets?

• Get-Command –noun SP* • Or…• Get-Command limited to the SharePoint

module/snapin (let’s see)

Page 8: Admin SharePoint 2010 with PowerShell

START THINKING…

• What SP admin tasks would YOU want to automate within the shell?

• Your ideas will drive our discovery of commands and capabilities… so start coming up with ideas!

Page 9: Admin SharePoint 2010 with PowerShell

Starting Commands

• Get-SPSite (get site collections)• Get-SPWeb (get Webs)• Try this:

Get-SPSite –limit All |Get-SPWeb –limit All |Where { -not $_.RequestAccessEnabled }

Page 10: Admin SharePoint 2010 with PowerShell

Limits

• Most Get-SP* commands limit to 20 objects• Use –Limit to change that; either numeric or

“All.”• Be aware of potential performance issues with

large result sets – avoid doing so on production servers unless necessary

Page 11: Admin SharePoint 2010 with PowerShell

Filters

• Most Get-SP* commands also include a –filter parameter

• Limits the results to just those that meet the filter criteria

• Best way to filter – as opposed to using Where – if the property you want to filter on is supported

Page 12: Admin SharePoint 2010 with PowerShell

Supported Filters

Get-SPSite• Owner• Secondary Onwer• LockState

Get-SPWeb• Title• Template

Get-SPWeb –filter {$_.Template –eq ’Blog’ }

Page 13: Admin SharePoint 2010 with PowerShell

Farms

• Get-SPFarm• Get-SPFarmConfig• Backup-SPFarm• Restore-SPFarm

Page 14: Admin SharePoint 2010 with PowerShell

Servers

• Get-SPServer [[-Identity] name]• Get-SPServer |

Where { $_.Role –eq "Application" }

Page 15: Admin SharePoint 2010 with PowerShell

Web Applications

• New-SPWebApplication• Get-SPWebApplication• Remove-SPWebApplication

Page 16: Admin SharePoint 2010 with PowerShell

Sites

• New-SPSite• Get-SPSite• Get-SPSiteAdministration• Backup-SPSite• Remove-SPSite

Page 17: Admin SharePoint 2010 with PowerShell

Webs

• New-SPWeb• Get-SPWeb• Remove-SPWeb

Page 18: Admin SharePoint 2010 with PowerShell

NOW… let’s do some Q&A

• I’ve got more demos to show you, but want to make sure I address your questions

• Ask ‘em now!• The remainder of the session will be additional

demos• Remember: Transcript will be downloadable; no

need to copy down the syntax• Ask for a “reminder card” if you want to download

this stuff next week.

Page 19: Admin SharePoint 2010 with PowerShell

Final Notes…

• Please be sure to submit a session evaluation form!• Download slides & materials from

www.ConcentratedTech.com within one week!• Blog, URLs, and other information is also available at

www.ConcentratedTech.com for your reference• More resources at www.ShellHub.com • Thank you very much!

Page 20: Admin SharePoint 2010 with PowerShell

Your Feedback is Important

Please fill out a session evaluation form.

Thank you!

Page 21: Admin SharePoint 2010 with PowerShell

This slide deck was used in one of our many conference presentations. We hope you enjoy it, and invite you to use it within your own

organization however you like.

For more information on our company, including information on private classes and upcoming conference appearances, please visit our Web

site, www.ConcentratedTech.com.

For links to newly-posted decks, follow us on Twitter:@concentrateddon or @concentratdgreg

This work is copyright ©Concentrated Technology, LLC