Fabian Schenker Consultant Microsoft Schweiz ShowerPoint - PowerShell und SharePoint für die Installation und Management von SharePoint 2010 Farmen Thomas.

Slides:



Advertisements
Similar presentations
Faith Allington Program Manager Microsoft Corporation WSV322.
Advertisements

Thomas Palmié Architect Microsoft Schweiz Implementierung eines mehrsprachigen Intranets basierend auf SharePoint 2010.
Painless PowerShell for SharePoint Admins Rick Taylor.
Gary Lapointe SharePoint MVP.  SharePoint MVP  Blog: 
02 | Managing Users, Groups, and Licenses Anthony Steven | Principal Technologist, Content Master Martin Coetzer | Portfolio Architect, Microsoft.
Non-displaying slide…. SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell 55095AC.
SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010.
Daniel Petri MVP, Microsoft Infrastructure Manager John Bryce Training November 2007.
02 | Install and Configure Team Foundation Server Anthony Borton | ALM Consultant, Enhance ALM Steven Borg | Co-founder & Strategist, Northwest Cadence.
Understanding Active Directory
Walter Pitrof Technology Solution Professional Microsoft Switzerland Backup, Restore und Disaster Recovery mit Data Protection Manager 2012 Philipp Witschi.
Purpose Intended Audience and Presenter Contents Proposed Presentation Length Intended audience is all distributor partners and VARs Content may be customized.
Purpose Intended Audience and Presenter Contents Proposed Presentation Length Intended audience is all distributor partners and VARs Content may be customized.
Module 12 Installing and Upgrading to SharePoint 2010.
SharePoint 2010 – Backup and Restore Alpesh Nakar.
Session 10 Windows Platform Eng. Dina Alkhoudari.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Using the WDK for Windows Logo and Signature Testing Craig Rowland Program Manager Windows Driver Kits Microsoft Corporation.
©2012 Microsoft Corporation. All rights reserved..
TechEd /22/2017 5:40 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
PowerShell Brian Caauwe – Senior Consultant April 14, 2012 The Administrator’s Best Friend.
A Day in the Life of a SharePoint Administrator Amit Puri Senior Development Lead Microsoft India.
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
Business Solutions Using Microsoft ® Office SharePoint ® Server ROADSHOW.
Module 3 Administering and Automating SharePoint.
Module 10 Administering and Configuring SharePoint Search.
“Click and Run ” “Click once repeat often” Admins Service Operations “ Install and forget” Engineering Support Key considerations: Deterministic, fool.
Todd Klindt and Shane Young SharePoint911. Who is this Todd guy?
03 | Manage Team Foundation Server Steven Borg | Co-founder & Strategist, Northwest Cadence Anthony Borton | ALM Consultant, Enhance ALM.
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
IIS Manager Details Delegated Administration Configuration System.
Microsoft ® Lync™ Server 2010 Setup and Deployment Module 04 Microsoft Corporation.
Tools and Tips for Administering Office 365
Reporting Services 2012 Data Alerts
Office PowerShell administration
Microsoft Office SharePoint Server 2007 Enterprise Search
Microsoft Virtual Academy
SaaS Application Deep Dive
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
6/17/2018 5:54 AM OSP322 Getting the best of both worlds, making the most of SharePoint hybrid search solutions Shyam Narayan Microsoft © 2013 Microsoft.
TFS Database Import Service for Visual Studio Team Services
Business Connectivity Services in SharePoint 2010 and Office 2010
Visio Services 2013 Collaboration APIs Chris Hopkins
7/28/ :17 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or.
Customize Office 365 Search and create result sources
Developing an app for SharePoint autohosted in Azure
Excel Services Deployment and Administration
Test Upgrade Name Title Company 9/18/2018 Microsoft SharePoint
SharePoint Online Management and Control
Office 365 Development.
11/11/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
Performance Point Services in SP2013
11/13/2018 3:26 PM MDC317B Complex Maintenance with Configuration Manager and Orchestrator – Patching Clusters Neil Peterson © 2013 Microsoft Corporation.
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Enterprise Metadata in SharePoint 2013
Migrating to Office 365 from Google mail and exchange
Microsoft Virtual Academy
12/9/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
System Admin Best Practices for NAV 2013 R2
2/27/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Explore PnP Partner Pack for IT pros, admins and architects
TechEd /23/2019 9:23 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Service Template Creation from the Ground Up
Tech Ed North America /27/ :04 AM Required Slide
Service Template Creation from the Ground Up
5/24/ :22 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Virtual Academy
PnP Partner Pack - Introduction
Microsoft Virtual Academy
Presentation transcript:

Fabian Schenker Consultant Microsoft Schweiz ShowerPoint - PowerShell und SharePoint für die Installation und Management von SharePoint 2010 Farmen Thomas Palmié Architect Microsoft Schweiz

Solution Overview PowerShell for SharePoint 2010 Overview Automated Installation of SharePoint 2010 farms Agenda

a good understanding about how to automate the provisioning of SharePoint 2010 farms understanding why this is not an option for larger environments Objectives

Installation of a SharePoint 2010 farm from one central location (SharePoint, pre-requisites, language packs, service applications) without internet connection using a simple XML config file Creating different service application pools Creating different proxy groups Minimal configuration on the servers where we want to install SharePoint Using DBA pre-created databases Setting permissions Executing pre- and post scripts Requirements

-SPModule: TechNet, uses own Windows PowerShell modules, uses Windows PowerShell remoting, only base installation Config DB and CA, requires internet connection for pre- requisites, no configuration file -Clonable SP2010 dev environment: basically for dev. purposes, sysprep, no AD Development-Environment-with-PowerShell-Windows-Sysprep-and-SQL-Server R2-Sysprep.aspx Development-Environment-with-PowerShell-Windows-Sysprep-and-SQL-Server R2-Sysprep.aspx -SharePoint easy setup script: for Windows7 installations, native or VHD installation, also for dev. Purposes,requires internet connection, documentation and labs are available,no AD, >2’000 lines of PowerShell -AutoSPInstaller: PowerShell + XML config file, installs SharePoint and Service Applications, poor documentation,>1’800 lines of Power Shell (one single file!) Existing Solutions

Advantages of our solution: -Clean structure (one file per activity) -Farm provisioning from one central location -Setting permissions -Easy XML configuration -Creates Service Application Pools, Service Applications -Proxy Groups -Offline installation -Language Packs -Office Web Apps Our Solution

Scripted installation of a SharePoint 2010 farm Solution Overview

Slipstream SP 1 bits: sharepointfoundation2010sp1-kb x64-fullfile-en- us.exe /extract: officeserver2010sp1-kb x64-fullfile-en-us.exe /extract: copy all of these extracted files into the “\Updates” folder of the extracted SharePoint Server 2010 RTM bits Preparing the Installation Extracting the.iso file Provide the Product Keys

Pre-Requisites

Starting the Installation

Automated Farm Installation Provisioning of Service Applications demo…

PowerShell for SharePoint 2010 Overview

Interact with.NET objects directly Perform administrative functions in bulk, reducing time and effort. Some SharePoint 2010 functions require the use of PowerShell: Resetting the Farm Passphrase How to Reset the Farm Passphrase in SharePoint 2010 Configuring the State Service Application Configuring the Publishing Feature’s Super User Accounts Performance benefits for batch operations Remoting interface SharePoint PowerShell Remoting Requirements SharePoint Remoting with PowerShell 2.0 Benefits of PowerShell

Used to find all the commands available to PowerShell Cmdlets generally have a verb-noun naming convention Get-ChildItem, Get-Member, Add-SPSolution, Backup-SPFarm, Export-SPWeb Get-Command -noun *infopath* Get-Command -noun *solution* List all available SP2010 cmdlets: Get-Command -PSSnapin “Microsoft.SharePoint.PowerShell” Get-Command

Used to show Synopsis, Syntax, Description, Parameters, and Examples Several ways to get help information on cmdlets: Get-Help Get-Help Get-SPSite -full Get-Help Get-SPSite -examples Get-Help Get-SPSite –detailed Get-Help *-SPSite -? Help Ex. Help database, Help Get-SPSite, etc. Paging Some results will only show a subset ending with “-- More -- ” = show next line or row = show next page or subset Can create paging by piping results to “more” Get-SPSite | more Get-Help

Aliases A way of calling a command using a keyword or abbreviation Most cmdlets have an associated alias to allow for shortcutting Get-Command = gcm Format-List = fl Set-Location = cd Get-ChildItem = dir Use Get-Alias to get a list of aliases available for your current session Use Set-Alias to create your own! Get-Member Gets the properties and methods of objects Get-SPSite | Get-Member Useful for when trying to determine what property you want to output Aliases and Get-Member

Still there and still works Remains for backwards compatibility Allows for portability of existing STSADM batch files and scripts Some commands have been removed (ex. all SSP related commands) You should start to do everything in PowerShell! Remember that it’s the “14 Hive” now C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN PowerShell > STSADM Newly created cmdlets were developed for enhanced performance PowerShell has full access to the SharePoint API from the command line STSADM to Windows PowerShell Mapping: STSADM?

Pipeline Allows output of one cmdlet to be the input of another cmdlet Examples Get-Process | Format-Table Name, CPU Get-SPWebApplication | Get-SPSite | Get-SPWeb Select-Object Allows you to pick available properties instead of grabbing all properties Get-SPSite | Get-SPWeb | Select URL, WebTemplate, LastItemModifiedDate Where-Object Only display results which meet a certain condition Get-SPLogEvent -StartTime (Get-Date).AddMinutes(-5) | Where-Object {$_.Level -eq “High”} Sort-Object Sort the result set by one or more property Get-SPSite | Sort Owner, URL Sort ascending (default) or descending Get-SPSite | Select URL, Owner, LastContentModifiedDate | Sort LastContentModifiedDate -Descending Pipeline, Select, Where, and Sorting

PipeBind Objects Allows different representations of an artifact to be passed into cmdlets Example: SPSitePipeBind accepts either a GUID, URL, or SPSite object Get-SPWeb [-Identity ] [-AssignmentCollection ] [-Confirm [ ]] [-Filter ] [-Limit ] [-Regex ] [-Site ] [-WhatIf [ ]] [ ] $site = Get-SPSite " $webs = $site | Get-SPWeb $webs = $site.ID | Get-SPWeb $webs = " | Get-SPWeb

SharePoint PowerShell examples demo…

Out-of-the-box only the Farm Account has permission to interact with SharePoint 2010 via PowerShell. This does not include additional Farm Administrators. Get-SPShellAdmin Lists who has rights to run PowerShell commands against the databases Add-SPShellAdmin Must be local admin, db_owner, and securityadmin to run this command properly User is added to WSS_Admin_WPG group on all WFEs and is added to the SharePoint_Shell_Access role on the database you specified Add-SPShellAdmin -username \ -database Portal_Content_DB If the database switch is not used, then the user is added access to the configuration database Remove-SPShellAdmin Remove-SPShellAdmin -username \ SP2010 PowerShell Permissions

PowerShell Threading Default behavior (V1 & V2): Each line, function, or script runs in it’s own thread $host.Runspace.ThreadOptions == "Default" Causes memory leaks with unreleased handles to unmanaged objects Management Shell: Each line, function, or script runs in the same thread $host.Runspace.ThreadOptions == "ReuseThread" Still has potential for memory leaks but impact is much less

Handling Disposable Items SPAssignmentCollection Collection object that all SharePoint cmdlets can accept to store objects that must be disposed Get-SPSite [-AssignmentCollection ] [-Confirm [ ]] [-Filter ] [- Limit ] [-WebApplication ] [-WhatIf [ ]] [ ]

Assignment Collections Start-SPAssignment Start-SPAssignment [-AssignmentCollection ] [-Global ] [ ] Stop-SPAssignment Stop-SPAssignment [-SemiGlobal ] [- AssignmentCollection ] [-Global ] [ ] Three levels of assignment: No assignment (dispose immediately) Simple assignment (use a global store) Advanced assignment (use a named store) Only Get-SPSite, Get-SPWeb, New-SPSite, and New-SPWeb use this disposal capability

Assignment Collection Example -Global stores items within an internal static variable -SemiGlobal is used for named variables and can be passed via the pipeline

Our Solution Automated Installation of SharePoint 2010 farms

Option 1: Remote PowerShell PowerShell Remoting uses WinRM, Microsoft’s implementation of the WS-Management protocol WinRM allows you to run scripts against remote servers over HTTP and HTTPS Works with V2 only Requires that WinRM be enabled on both the client and the server Option 2: Scheduled Tasks Inter Server Communication

Usage of Scheduled Tasks

Farm Creation Cmdlet NameDescription New-SPConfigurationDatabase Creates a new configuration database, and therefore a new SharePoint farm. This cmdlet is run only once per farm. Connect-SPConfigurationDatabase Connects a server to an existing configuration database thus adding the server to the farm. This cmdlet is run once per server in the farm after the first server is provisioned using New-SPConfigurationDatabase. Initialize-SPResourceSecurity Sets required file, folder, and registry ACLs for the local server. This cmdlet must be run for each server in the farm. Install-SPService Installs the services in the farm. This cmdlet is run once per farm (in a standalone configuration it is possible to automatically provision the services by running the cmdlet again, providing the –Provision parameter) : PS C:\> Install-SPService Install-SPFeature Installs all the Features available to the farm. This cmdlet is run once per farm using the -AllExistingFeatures parameter: PS C:\> Install-SPFeature -AllExistingFeatures New-SPCentralAdministration Provisions a central administration site on the local server. This cmdlet is typically run only once per farm but can be run on additional servers as is needed. Install-SPHelpCollection This optional cmdlet installs the help files that are used throughout the farm. This cmdlet is run only once per farm on the same server as the central admin site unless installing new help collections (custom or third party). Provide the -All switch when calling this cmdlet for Farm setup. PS C:\> Install-SPHelpCollection -All Install-SPApplicationContent This optional cmdlet installs any application content for the central administration site. This cmdlet is run only once per farm on the same server as the central administration site.

Site Structure Creation Cmdlet NameDescription New-SPManagedAccount Creates a new managed account which can be used when creating the application pool. New-SPWebApplication Creates a new web application. New-SPContentDatabase Creates a new content database for a specific web application. New-SPManagedPath Creates a managed path under the specified web application. New-SPSite Creates a new Site Collection (watch for disposal issues!) New-SPWeb Creates a new Site within a Site Collection (watch for disposal issues!) Set-SPDesignerSettings Sets the actions that users can perform using SharePoint Designer.

Service Application Setup/Configuration Cmdlet NameDescription Get-SPServiceInstance Returns back the service instances installed on the server. Use this cmdlet to check if a service instance is online prior to enabling. $svc = (Get-SPServiceInstance | Where {$_.TypeName -eq "Managed Metadata Web Service"}) Start-SPServiceInstance The actual service instance. For most services this can be called on more than one server to provide failover and load balancing. if ($svc.Status –eq "Disabled") { $svc | Start-SPServiceInstance } while($svc.Status -ne "Online") { Write-Host -ForegroundColor Yellow "Waiting for Metadata service to provision"; sleep 5; } New-SP*ServiceApplication Defines the actual service definition and configurations for a service instance. Most service applications allow multiple instances per farm with different configurations and proxy group associations. PS C:\> Get-Command New-SP*ServiceApplication New-SP*ServiceApplicationProxy The “service connection” that allows communication with the service application. It is only necessary to run this once per service application. PS C:\> Get-Command New-SP*ServiceApplication Proxy New-SPServiceApplicationProxyGroup Add-SPServiceApplicationProxyGroupMember Allows service applications to be grouped. Proxy groups are then associated with one or more web applications.

Some examples Automated Installation Lessons Learned

Creating Service Application Pools New-SPServiceApplicationPool –Name -Account Service Application Pools appears as IIS Application Pool, as soon as a Service Application is created. Creating IIS Application Pools for Web Applications Creating the Application Pool by creating a Web Application. New-SPWebApplication –ApplicationPool -ApplicationPoolAccount -Name…. If the Application Pool exists: -ApplicationPoolAccount is not allowed! If the Application Pool doesn’t exist: -ApplicationPoolAccount is required. there is no relationship between the Service Application Pools and Web Application Pools Service application pools are created as a GUID in IIS Web Application pools but with the "display name" Service Application Pool != IIS Application Pool

How to Troubleshoot Scripts that are running using a Scheduled Task? Transcripts! Start-Transcript –Path Stop-Transcript Everything that happens in between is written to a Log File! Remote Troubleshooting

Questions: Naming? Size and Growth? How many Datafiles? Location of Log and Datafiles? Think about those Questions during the engineering phase! Don’t let SharePoint create your Databases! Security for prestaged Databases: BDC & Secure Store Service Databases: Owner = Farm Account All other Service Application Databases: Owner = Setup Account. Content Databases: Owner = Setup Account Content Databases: Office Web Apps Application Pool Account as db_owner! Database Prestaging

Add-PSSnapin SqlServerCmdletSnapin100 Invoke-Sqlcmd –Query «» –ServerInstance -Database

State Service Application doesn’t allow prestaged Databases during Configuration of the Service Application. Mount the Database after the Configuration!

Let’s have a look at the new provisioned farm demo…

PowerShell Command Builder: us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html SPModule: TechNet, uses own Windows PowerShell modules, uses Windows PowerShell remoting, only base installation Config DB and CA, requires internet connection for pre-requisites, no configuration file Clonable SP2010 dev environment: basically for dev. purposes, sysprep, no AD Development-Environment-with-PowerShell-Windows-Sysprep-and-SQL-Server-2008-R2- Sysprep.aspx Development-Environment-with-PowerShell-Windows-Sysprep-and-SQL-Server-2008-R2- Sysprep.aspx SharePoint easy setup script: for Windows7 installations, native or VHD installation, also for dev. Purposes,requires internet connection, documentation and labs are available,no AD, >2’000 lines of PowerShell AutoSPInstaller: PowerShell + XML config file, installs SharePoint and Service Applications, poor documentation,>1’800 lines of Power Shell (one single file!) Resources

Automating SharePoint 2010 with Windows PowerShell 2.0 : PowerShell/dp/ /ref=sr_1_1?s=books&ie=UTF8&qid= &sr=1-1 PowerShell/dp/ /ref=sr_1_1?s=books&ie=UTF8&qid= &sr=1-1 Resources

Please help us make TechDays even better by Evaluating this Session. Thank you! Give us your feedback!

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.