Everybody knows PowerShell is powerful, it’s in the name! But did you know that PowerShell can read and understand XML? By leveraging XML among other things, complete builds can be automated – making them efficient and predictable.In this fun, interactive and demo-filled session – I will show you how you can leverage PowerShell to help you build your branded, company website from the ground up using PowerShell and XML. I will also pass along some tips and tricks that will help you become a PowerShell Rockstar!
4. About The Speaker
Ryan Dennis, MCTS, MCPD, MCITP
Senior SharePoint Engineer @ ICC
Microsoft Virtual Technology Specialist (vTSP)
www.SharePointRyan.com
@SharePointRyan
linkedin.com/in/sharepointryan
ryan@sharepointryan.com
5. What is SharePoint 2010 FIS?
• FIS = For Internet Sites
• The license which allows you to build public-facing sites
without paying for lots of CALs
• Fundamentally it is no different than the standard
SharePoint version, it’s all about the licensing…
• For license specific questions, ask someone smarter than
me…
6. Agenda
• What is SharePoint 2010 FIS?
• Quick intro to SharePoint + PowerShell
• SharePoint website considerations
• Using a spectacular set of PowerShell code to automate
the provisioning of complete, branded sites
• Q&A
7. SharePoint 2010 Cmdlets
• 500+ Cmdlets…
• MUCH better than STSADM.exe…
• Can automate complete installations and
configurations…
• Still doesn’t answer every scenario, leaving
gaps in functionality…
– Example: Get, New and Remove SharePoint Groups – no
cmdlet, easy to write a custom function though…
8. Agenda
• What is SharePoint 2010 FIS?
• Quick intro to SharePoint + PowerShell
• SharePoint website considerations
• Using a spectacular set of PowerShell code to automate
the provisioning of complete, branded sites
• Q&A
10. Where XML comes in
• PowerShell can get XML data using a Type
Accelerator and the Get-Content cmdlet
• Example:
[xml]$xml = Get-Content C:SomeFile.xml
[xml] is the type accelerator, declaring the type as
System.Xml.XmlDocument
11. Getting the content
• There are a few cmdlets that can make bulk tasks
VERY easy and fun…
– Get-Content
– ForEach-Object
• Using these in conjunction with other SharePoint
cmdlets or custom functions can make your
PowerShell life much more awesome…
12. What were those again?
• Get-Content
– Can read the contents of a file…
– Can store the contents in a variable…
– Can process XML files…
– Can be piped into other cmdlets…
• ForEach-Object
– Provides a way to loop through - and perform
an action on - each item in a collection.…
14. How PowerShell makes it all
happen
• Using PowerShell, we can automate:
– Creating the Web Application
– Creating the Site Collection(s)
– Configuring Caching
– Activating Features for Branding, SEO Tagging, etc.
– Creating the Enterprise Search Center
– Configuring Search Scopes and Target Results Page
– Creating Subsites
– Creating Pages
– Adding Content to Pages
– Making Dinner (OK, maybe not – but I’m sure V3 will)
15. Agenda
• What is SharePoint 2010 FIS?
• Quick intro to SharePoint + PowerShell
• SharePoint website considerations
• Using a spectacular set of PowerShell
code to automate the provisioning of
complete, branded sites
• Q&A
16. USING A SPECTACULAR SET OF
POWERSHELL CODE TO AUTOMATE
THE PROVISIONING OF COMPLETE,
BRANDED SITES
DEMONSTRATION
17. Demo Recap
• Used PowerShell to automate:
– Creation of the Web Application
– Creation of the Site Collection(s)
– Configuration of caching (BLOB, Output)
– Feature activation
– Application of custom branding
– Search configuration
– Subsite creation
– Page creation
– Content addition
– SEO Meta Tag creation
– Creation of custom footer list from list template
– Warming up/caching of the sites for our viewing pleasure
18. Presentation Recap
• XML is a great way to store input for
scripts and functions
• PowerShell is an awesome way to
automate the building of entire, content
filled, branded, SharePoint-based websites
using XML as the input mechanism
Talk about the Meta Fields and XML Features
Demonstrate how to edit the page fields using the Meta Fields feature
Show page source after editing the fields