Presented at the Research Triangle PowerShell Users Group, Durham NC, September 17, 2014
As the role of the SharePoint Administrator continues to evolve, as have the tools. PowerShell has become an integral component of the SharePoint Administrator’s tool bag, whether administering SharePoint On-Premises, or as an Office 365 solution. In this session, we’ll look at day-to-day use cases of PowerShell as the primary tool for SharePoint administration, as well as the differences and restrictions between PowerShell for SharePoint On-Premise and O365.
Scanning the Internet for External Cloud Exposures via SSL Certs
PowerShell Introduction to Administering SharePoint On-Premises & O365
1. mike-greene.com
@webdes03
PowerShell Introduction to Administering SharePointOn-Premises & O365
Research Triangle PowerShell User Group
September 17, 2014
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 1
2. mike-greene.com
@webdes03
Introduction
B&R Business Solutions
•SharePoint Solution Architect
•Based in Raleigh, North Carolina
Professional Experience
•Microsoft SharePoint Stack since 2007
•Consulting and Professional Services since 2010
•Public Web Design since 2003
Hobbies
•SharePoint Saturday & User Group SpeakerRIC, VB, ATL, AUS, TPA, RDU
•Leadership Council, Triangle SharePoint User Group
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 2
5. mike-greene.com
@webdes03
What is PowerShell
•Microsoft task automation framework built on the .NET framework
•Common “shell” to Microsoft technologies (AD, SQL, SP, Server, etc.)
•Full access to COM (Component Object Model) and WMI (Windows Management Instrumentation) for local and remote system management
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 5
8. mike-greene.com
@webdes03
Administrators Toolkit
•Role of the SharePoint Administrator has evolved over the years
•SharePoint is not a “set and forget” application
•With the evolution of the product, and the role of the administrator, tools have matured
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 8
Farm Deployment
Site Administration
Database Management
Service Management
9. mike-greene.com
@webdes03
Administrators Toolkit
STSADM
Third Party Tools
PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 9
•PowerShell replaces STSADM
•All STSADM operations have a PowerShell equivalent
•Integrated support for multiple platforms/services
•Easily extendable
SharePoint 2007
SharePoint 2013
11. mike-greene.com
@webdes03
Working with PowerShell
•Registers sets of cmdlets/providers
•Extends default shell functionality
•Conceptually similar to a browser plug-in
•Snapinscan be added or removed as needed during a session
•Loaded snapinsare disposed with the session
•Can be automatically loaded with new sessions by using a PowerShell profile
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 11
Snapins
Cmdlets
Objects
Properties
Methods
12. mike-greene.com
@webdes03
Working with PowerShell
•Registers sets of cmdlets/providers
•Extends default shell functionality
•Conceptually similar to a browser plug-in
•Snapinscan be added or removed as needed during a session
•Loaded snapinsare disposed with the session
•Can be automatically loaded with new sessions by using a PowerShell profile
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 12
Snapins
Cmdlets
Objects
Properties
Methods
Test-Path $profile
New-Item –Type File –Force $profile
Notepad $profile
13. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 13
Snapins
Cmdlets
Objects
Properties
Methods
•“Command-let”; specific command executed in the PowerShell environment
•Follow common {verb} –{noun} naming convention; easy to understand
•Used like a function, cmdletstake one or more input arguments and output objects
•Can be piped together for complex operations
14. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 14
Snapins
Cmdlets
Objects
Properties
Methods
•Container of one or more objects, properties or methods; objects can contain other objects
•Hierarchical structure, similar to XML, objects have no preset structure and can be created to serve virtually any purpose
House
15. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 15
Snapins
Cmdlets
Objects
Properties
Methods
•Container of one or more objects, properties or methods; objects can contain other objects
•Hierarchical structure, similar to XML, objects have no preset structure and can be created to serve virtually any purpose
House
Floors
1
2
3
16. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 16
Snapins
Cmdlets
Objects
Properties
Methods
•Distinct pieces of data on an object
•When working with an object, you’re really interacting with the properties inside the object
House
Color
White
Floors
1
2
3
17. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 17
Snapins
Cmdlets
Objects
Properties
Methods
•Actionable operation on an object
•Manipulates the object in some predefined manner
House
Color
White
Floors
1
2
3
Open Door
Open
18. mike-greene.com
@webdes03
Working with PowerShell
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 18
Snapins
Cmdlets
Objects
Properties
Methods
•$house = Get-HouseCreates $house
•$house.Floors.Count()Outputs “3”
•$house.ColorOutputs “White”
•$house.OpenDoor()Returns “Open”
House
Color
White
Floors
1
2
3
Open Door
Open
20. mike-greene.com
@webdes03
SharePoint On-Premises
•Thetool for day-to-day administration of SharePoint On-Premises
•Critical to version upgrades and other heavy maintenance activities
•Full access to the SharePoint Farm object model
•Full access to the SharePoint API
•Ability to run full trust code
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 20
1900+ Cmdlets
21. mike-greene.com
@webdes03
SharePoint Farm Deployment
•PowerShell deployment considered best practice; never use “The Wizard”
•Least privilege deployment achievable only via PowerShell
•Distributed Cache and other core SharePoint services require PowerShell configuration
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 21
XML Configuration File
Service Account Provisioning
SQL Configuration
SharePoint Installation
SharePoint Farm Provisioning
SharePoint Farm Configuration
22. mike-greene.com
@webdes03
SharePoint Farm Upgrade
•PowerShell required to prepare a farm for upgrade (version upgrades & service packs)
•Pre-upgrade cleanup tasks managed through PowerShell
•Test-SPContentDatabasevalidates content DB’s prior to upgrade
•Database attach upgrade
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 22
Pre-upgrade Checks
Content Database Checks
Upgrade Operation
23. mike-greene.com
@webdes03
Generate SharePoint IA
•Utilize SharePoint cmdletsto deploy farm topology
•Web Applications (SPWebApplication)
•Site Collections (SPSite)
•Subsites(SPWeb)
•Lists (SPList)
•Repeatable deployment across multiple environments; more efficient than manual generation
9/17/2014 PowerShell Introduction to Administering SharePoint On-Premises & O365 23
intranet.corp.tld
Intranet
News
Departments
HR
IT
Legal
Search
Records