Building your SharePoint Farm with PowerShell

Slides:



Advertisements
Similar presentations
Lesson 17: Configuring Security Policies
Advertisements

James Boother Blog: INTRODUCTION TO POWERSHELL.
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010.
Welcome to the Minnesota SharePoint User Group November 11 th, 2009 Prepare for SharePoint 2010 Wes Preston, Brian Caauwe Meeting.
Welcome to the Minnesota SharePoint User Group November 11 th, 2009 SharePoint 2010 Administration Wes Preston, Brian Caauwe.
10 PowerShell Commands Every Admin Should Know David Price.
Becky Bertram SharePoint MVP
Server Roles and Features.NET Framework 3.51.NET Framework 4.5 IIS Web Server IIS Default Document IIS Directory Browsing IIS HTTP Errors.
Welcome Course 20410B Module 0: Introduction Audience
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
Jeffrey Snover Distinguished Engineer Microsoft Session Code: SRV312.
VMware vCenter Server Module 4.
Winter Consolidated Server Deployment Guide for Hosted Messaging and Collaboration version 3.5 Philippe Maurent Principal Consultant Microsoft.
EPM 2007 Implementation and Upgrade Tips Summary June 18th, 2008 Brendan Giles, PMP, MCP.
Hosted Exchange The purpose of this Startup Guide is to familiarize you with ExchangeDefender's Exchange and SharePoint Hosting. ExchangeDefender.
Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
Deploying and Managing Windows Server 2012
Module 12 Installing and Upgrading to SharePoint 2010.

Hands-On Microsoft Windows Server 2008 Chapter 1 Introduction to Windows Server 2008.
8.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 8: Introducing Computer Accounts.
5.1 © 2004 Pearson Education, Inc. Lesson 5: Administering User Accounts Exam Microsoft® Windows® 2000 Directory Services Infrastructure Goals 
Microsoft ® Official Course Module XA Using Windows PowerShell ®
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
Appendix A Starting Out with Windows PowerShell™ 2.0.
Microsoft FrontPage 2003 Illustrated Complete Finalizing a Web Site.
Welcome to the Delaware Valley SharePoint User Group Russ Basiura SharePoint Consultant RJB Technical Consulting
Module 4 : Installation Jong S. Bok
POWERSHELL SHENANIGANS KIERAN JACOBSEN HP ENTERPRISE SERVICES.
Module 1: Configuring Windows Server Module Overview Describe Windows Server 2008 roles Describe Windows Server 2008 features Describe Windows Server.
What’s New in SharePoint 2010 SharePoint 2010 Development Primer New Developer Tools for SharePoint 2010 SharePoint 2010 Integration with PowerShell.
Corey Hynes HynesITe, Inc Session Code: SRV317 Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Office 365: SharePoint Online 31 May | SharePoint Saturday Calgary – 31 MAY 2014 About Me – Jason Kaczor
Microsoft ® Official Course Module 6 Managing Software Distribution and Deployment by Using Packages and Programs.
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
Application Lifecycle Management - automated builds and testing for SharePoint projects Chris O’Brien SharePoint MVP OSP432.
Windows Certification Paths OR MCSA Windows Server 2012 Installing and Configuring Windows Server 2012 Exam (20410) Administering Windows Server.
Windows Server 2003 { First Steps and Administration} Benedikt Riedel MCSE + Messaging
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
2nd year Computer Science & Engineer
Managing Windows Server 2012
Office PowerShell administration
The Administrator’s Best Friend
Lesson 6: Configuring Servers for Remote Management
PowerShell Introduction Copyright © 2016 – Curt Hill.
Windows Server 8 beta og Windows PowerShell 3.0
Exam In The First Attempt?
PowerShell 2.0 Remoting Ravikanth C.
Using Microsoft Identity Manger with SharePoint 2016 to fill the User Profile Sync Gap Max Fritz Senior Systems Consultant Now Micro.
Creating an Oracle Database
Braindumps Questions Answers
Technical Overview (IT Pro)
Common Security Mistakes
Microsoft FrontPage 2003 Illustrated Complete
© 2007 Asynchrony Solutions, Inc. 1 10/29/07 Introduction to PowerShell Brian Button VP Engineering Asynchrony Solutions, Inc
SharePoint Saturday Omaha April 2016
Windows PowerShell Remoting: Definitely NOT Just for Servers
Migrating to Office 365 from Google mail and exchange
HC Hyper-V Module GUI Portal VPS Templates Web Console
SharePoint Online Hybrid – Configure Outbound Search
Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting
SharePoint Permissions Manager
Mass Hunting and exploitation with powershell
Tech Ed North America /27/ :04 AM Required Slide
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
SharePoint 2013 Best Practices
Presentation transcript:

Building your SharePoint Farm with PowerShell Presentation Title Bill Brockbank Solution Architect – SharePoint MVP Navantis Inc. http://blog.billbrockbank.net Brian Lalancette Infrastructure Consultant TSBUG – March 16th 2011

What is Windows PowerShell? Presentation Title What is Windows PowerShell? An interactive command-line and task-based scripting technology. Allows IT professionals to accelerate automation of tasks. What about developers (or IT Pro Developers) A single mindset for management of many different systems (e.g.: AD, Exchange, Windows and now SharePoint) Via PowerShell Module Extensible framework that can be embedded inside other applications – not just a command line replacement!

Welcome to SharePoint PowerShell The History Presentation Title SharePoint v1/v2 (2001-2003): No command-line interface SharePoint 2007: STSADM: 182 Commands (MOSS) There are some community support (Gary Lapointe) but this was just away to access the SharePoint OM. SharePoint 2010 652 PowerShell cmdlets Superset of Administration UI* Extensible Platform In-line Discoverability Optimized for Batch Operations No support for Installing the bits

Why PowerShell Speed and Style Presentation Title Deal with the .NET objects directly (Any) Remoting support to your SharePoint Services Performance benefits for batch operations Start Thread New STSADM Execution Start Logging Execute Command Load DLLs Stop Logging Close STSADM & Thread Repeat STSADM Batch Operation Start Thread Stop Thread PowerShell Cmdlets in Batch Start logging Execute Command Stop logging Repeat

SharePoint PowerShell Basics Presentation Title Cmdlets for “Getting, Creating, Configuring” various SharePoint Objects. For e.g.: Sites, Site Collections, Web Applications, Service Applications and related commands PipeBinds for “getting a unique object” Examples: SPSitePipeBind: GUID, URL, or SPSite Object are all accepted SPContentDatabasePipeBind: GUID, Name, or SPContentDatabase

Demo PowerShell “Remoting”

Presentation Title PowerShell Remoting New in PowerShell V2 – Support via WinRM Supporting in Windows Server 2008 R2 and Windows 7 A remote interaction involves 2 endpoints – Client and a Server PowerShell depends on WinRM for transport of data between endpoints

PowerShell “Remoting” and SharePoint Presentation Title PowerShell “Remoting” and SharePoint Windows PowerShell Remoting needs to be enabled first Windows PowerShell Remoting needs to be enabled first by calling the following cmdlet in Windows PowerShell: Enable-PSRemoting You MUST use CredSSP authentication. To enable CredSSP on the server, use the following command: Enable-WSManCredSSP –Role Server To enable CredSSP on the client, use the following command: Enable-WSManCredSSP -Role client -DelegateComputer * Increase the MaxMemoryPerShellMB value on the remote boxes which essentially limits the amount of memory that any single remote process can use. Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000 In a brief “lapse” from the “Intro to PowerShell” sections I wanted to outline some important background for those of you anxious to run your SharePoint administration commands from a remote console.  Keep in mind that just running Enable-PSRemoting is not enough! There are a few unique requirements that the SharePoint environment adds to running remote commands: 1.        You MUST use CredSSP authentication.  Any command that talks to a SharePoint cmdlets that itself talks to SQL (which is most commands) will need to call SQL “as you”.  This means you need the ability to “double hop”—which CredSSP provides.  This is enabled using the “Enable-WSmanCredSSP” cmdlets.    (if you don’t use this you’ll most likely see a message saying the farm does not exist or you do not have enough privledges). 2.       You SHOULD increase the MaxMemoryPerShellMB value on the remote boxes which essentially limits the amount of memory that any single remote process can use.  I would not recommend doing this on every box—but rather an “admin machine” that is not externally available.  The default value is 150MB, which will often fail for Site Collection creation and other long-running commands. You can change this value to a larger value (in this example 1000) using the Set-Item cmdlet: Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000 You may hit other “WSman” specific configuration issues along the way—they are often specific to your domain.  However, these error messages are usually quite detailed and I have found over time to always include enough information to solve the problem right away.

Presentation Title PowerShell Modules Microsoft has add several PowerShell Modules with Windows Server 2008 R2. Get-Modules –ListAvaible ADRM – Microsoft Windows Active Directory Rights Management Services Module BestPractices – Best Practices Analyzer (BPA) BitsTransfer –Background Intelligent Transfer Management (BITS) ServerManger – Server Manager module TroubleshootingPack –Microsoft Windows Troubleshooting Pack Module WebAdministration – Web Server Administration module ImportSystemModules – will load all of the Modules into PowerShell gcm –module <Module name> Example: gcm –module ServerManager cmdlet Add-WindowsFeature cmdlet Get-WindowsFeature cmdlet Remove-WindowsFeature

PowerShell SPModule for SharePoint Presentation Title PowerShell SPModule for SharePoint SPModule written by members of the SharePoint Product Group in our spare time. Downloaded form Microsoft Download site. The SPModule files are a sample Windows PowerShell module related to farm installation. Not more PowerShell cmdlet’s for SharePoint SPModule: Is a collection of PowerShell functions 2 PowerShell Modules with 18 function: SPMosule.Misc (9) SPModule.Setup (9) Install-SharePoint, New-SharePointFarm, Join-SharePointFarm, …. PS C:\Windows\system32> gcm -Module spmodule.setup CommandType Name Definition ----------- ---- ---------- Function Disable-AllSigningCheck ... Function Disable-OfficeSigningCheck ... Function Disable-SQLSigningCheck ... Function Enable-VerboseMsiLogging ... Function Install-SharePoint ... Function Join-SharePointFarm ... Function New-SharePointFarm ... Function New-SharePointServices ... Function Start-CentralAdministration ... PS C:\Windows\system32> gcm -Module spmodule.misc Function Backup-Logs ... Function Compress-ToZip ... Function Get-RegistryKey ... Function Get-ThreadOptions ... Function Install-Assembly ... Function Set-RegistryKey ... Function Set-ThreadOptions ... Function Test-ElevatedProcess ... Function Test-SPModuleVersion ...

Presentation Title How To Use SPModule Importing it, this can be done before you install SharePoint on the server and it cam be do remotely. Import Spmodule in to PowerShell $env:PSModulePath = “C:\SPModule;” + $env:PSModulePath Import-Module SPModule.misc Import-Module SPModule.setup Executing SPModule functions: Install-SharePoint -SetupExePath “\\servername\SharePoint2010-Beta\setup.exe” -PIDKey “PKXTJ-DCM9D-6MM3V-G86P8-MJ8CY”  New-SharePointFarm –DatabaseAccessAccount (Get-Credential DOMAIN\username) – DatabaseServer “SQL01” –FarmName “TestFarm” Join-SharePointFarm -DatabaseServer “SQL01” -ConfigurationDatabaseName “TestFarm_SharePoint_Configuration_Database” Backup-Logs -outp “$env:userprofile\Desktop\SharePointLogs.zip”

“Remoting” - SPModule One you have enable the server and clients, you can now connect to the from the client to your servers. Connect to the remote server “sp2010-few” the the spinst user account, you will be prompted for the accounts password. Enter-PSSession -ComputerName sp2010-few -Authentication CredSSP -Credential $Env:USERDOMAIN\spinst Run a script on the server – in this case it imports SPModule and runs the Install- SharePoint function . 'C:\Software\SharePoint Build Scripts\InstallSP2010Server.ps1‘ Close the remote session Exit-PSSession

IntallSP2010Server.ps1 script Set-ExecutionPolicy -ExecutionPolicy Bypass # Import SPModule's $env:PSModulePath = "C:\Software\SharePoint Build Scripts\SPModule;" + $env:PSModulePath Import-Module SPModule.misc Import-Module SPModule.setup $InstallDirectory = "C:\Microsoft SharePoint Servers\14.0\" $SetupExePath = "C:\Software\SharePoint Server 2010\" $DataDirectory = $InstallDirectory + "Data" # SharePoint Server 2010 Product Key $PKEY = “AAAAA-12345-XTXT1-22222-BPX4E" Install-SharePoint -InstallDirectory $InstallDirectory -DataDirectory $DataDirectory -SetupExePath $SetupExePath - PIDKey $PKEY

Demo SharePoint SPModule

Presentation Title Referrences Zach Rosenfield Blog http://sharepoint.microsoft.com/Blogs/zach/default.aspx Signing Your PowerShell Scripts http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=53 SPModule.HelloWorld() http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=54 Windows PowerShell Remoting http://msdn.microsoft.com/en- us/library/ee706585(VS.85).aspx SharePoint 2010 with Windows PowerShell Remoting Step by Step http://blogs.msdn.com/b/opal/archive/2010/03/07/sharepoint-2010-with- windows-powershell-remoting-step-by-step.aspx

More Referrences SharePoint PowerShell “Remoting” Requirements http://sharepoint.microsoft.com/blogs/zach/Lists/Posts/Post.aspx?ID=45 SPModule Download http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=c575 56ff-8df0-44fd-aba6-3df01b9f80ce AutoSPInstaller http://autospinstaller.codeplex.com/

AutoSPinstaler (Brian Lalancette) Presentation Title AutoSPinstaler (Brian Lalancette)