Module 3 Administering and Automating SharePoint.

Slides:



Advertisements
Similar presentations
Module 5: Creating and Configuring Group Policy
Advertisements

Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
Non-displaying slide…. SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell 55095AC.
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.
Fabian Schenker Consultant Microsoft Schweiz ShowerPoint - PowerShell und SharePoint für die Installation und Management von SharePoint 2010 Farmen Thomas.
SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010.
Chapter 5: Configuring Users and Groups. Windows Vista User Accounts User accounts are the primary means of authentication Built-in Accounts –Administrator:
10 PowerShell Commands Every Admin Should Know David Price.
Microsoft ® Official Course Publishing and Distributing Apps Microsoft SharePoint 2013 Sriram – SharePoint Practice.
Microsoft ® Official Course Introducing Apps for SharePoint SharePoint Practice Microsoft SharePoint 2013.
7.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 7: Introducing Group Accounts.
Module 8 Implementing Backup and Recovery. Module Overview Planning Backup and Recovery Backing Up Exchange Server 2010 Restoring Exchange Server 2010.
Web FOCUS Integration with Microsoft Office SharePoint By: Kelvin Ruiz NASA – Kennedy Space Center.
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Microsoft ® Official Course Module 4 Automating Active Directory Domain Services Administration.
Module 4 Managing Client Access. Module Overview Configuring the Client Access Server Role Configuring Client Access Services for Outlook Clients Configuring.
Microsoft ® Official Course Module 9 Configuring Applications.
Module 2 Creating Active Directory ® Domain Services User and Computer Objects.
Deploying and Managing Windows Server 2012
Module 2 Creating a SharePoint 2010 Intranet. Start the Virtual Machines 1. Start 10174A-CONTOSO-DC-B. 2. After CONTOSO-DC has completed startup, start.
Module 2 Configuring Mailbox Servers. Module Overview Overview of Exchange Server 2010 Administrative Tools Configuring Mailbox Server Roles Configuring.
Module 12 Installing and Upgrading to SharePoint 2010.
Module 13: Configuring Availability of Network Resources and Content.
Module 4: Add Client Computers and Devices to the Network.
Implementing File and Print Services
Securing Microsoft® Exchange Server 2010
Module 8 Configuring and Securing SharePoint Services and Service Applications.
Managing Active Directory Domain Services Objects
Microsoft ® Official Course Module XA Using Windows PowerShell ®
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
PowerShell Basics. o PowerShell is a great way to manipulate server and/or workstation components o It’s geared toward system administrators by creating.
Appendix A Starting Out with Windows PowerShell™ 2.0.
Module 2 Designing Microsoft® Exchange Server 2010 Integration with the Current Infrastructure.
Section 1: Introducing Group Policy What Is Group Policy? Group Policy Scenarios New Group Policy Features Introduced with Windows Server 2008 and Windows.
Module 7: Fundamentals of Administering Windows Server 2008.
20411B 8: Installing, Configuring, and Troubleshooting the Network Policy Server Role Presentation: 60 minutes Lab: 60 minutes After completing this module,
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Module 3: Configuring Active Directory Objects and Trusts.
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.
Introduction to Microsoft Management Console (MMC) MMC is a common console framework for management applications. MMC provides a common environment for.
Module 1: Configuring Windows Server Module Overview Describe Windows Server 2008 roles Describe Windows Server 2008 features Describe Windows Server.
Module 13 Implementing Business Continuity. Module Overview Protecting and Recovering Content Working with Backup and Restore for Disaster Recovery Implementing.
Module 10 Administering and Configuring SharePoint Search.
Module 6 Securing Content. Module Overview Administering SharePoint Groups Implementing SharePoint Roles and Role Assignments Securing and Auditing SharePoint.
Module 3 Configuring File Access and Printers on Windows 7 Clients.
Module 3 Managing Recipient Objects. Module Overview Managing Mailboxes Managing Other Recipients Configuring Address Policies Configuring Address.
Module 3: Managing a Microsoft ® Windows ® Small Business Server Environment.
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
Module 5: Creating and Configuring Group Policies.
Module 4 Planning for Group Policy. Module Overview Planning Group Policy Application Planning Group Policy Processing Planning the Management of Group.
Module 3: Configuring Mailbox Server Roles. Overview Overview of Exchange Server 2007 Administration Tools Implementing Mailbox Server Roles Managing.
What’s New in SharePoint 2010 SharePoint 2010 Development Primer New Developer Tools for SharePoint 2010 SharePoint 2010 Integration with PowerShell.
Module 2 Configuring Mailbox Servers. Module Overview Overview of Exchange Server 2010 Administrative Tools Configuring Mailbox Server Roles Configuring.
Todd Klindt and Shane Young SharePoint911. Who is this Todd guy?
Module 9 User Profiles and Social Networking. Module Overview Configuring User Profiles Implementing SharePoint 2010 Social Networking Features.
Implementing a Group Policy Infrastructure
Module 12: Configuring and Managing Storage Technologies
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Windows PowerShell. What is Windows PowerShell? A command-line interface (CLI) A new way of developing Windows and other products to be more manageable.
Microsoft ® Official Course Module 4 Automating Active Directory Domain Services Administration.
Microsoft ® Official Course Implementing Enterprise Content Management Microsoft SharePoint 2013 SharePoint Practice.
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
Ravikanth C.
PowerShell 101 sharepoint on-premise
Deploying and Configuring SSIS Packages
Migration to SharePoint 2013
What Is Sharepoint? Mohsen Ashkboos
Presentation transcript:

Module 3 Administering and Automating SharePoint

Module Overview Configuring Central Administration Administering SharePoint from the Command Line Automating SharePoint Operations with Windows PowerShell

Lesson 1: Configuring Central Administration Administrative Options Central Administration Administrative Roles

Administrative Options Central Administration Stsadm  C:\Program Files\Common Files\Microsoft Shared\ web server extensions\14\BIN Windows PowerShell SharePoint 2010 Management Shell  Supports Stsadm Includes the BIN folder (STSADM) in its path configuration  Preloads the SharePoint snap-ins for Windows PowerShell

Central Administration Web application  Everything is done using the app pool identity for the Central Administration Web application: SP_Farm  If something is not working, be sure SP_Farm has permissions Local Administrators group on each SharePoint server SQL Server permissions Change the port  Windows PowerShell Set-SPCentralAdministration -Port Blocks port 443 (SSL) Blocks ports  Stsadm stsadm –o setadminport

Administrative Roles Farm Administrators  Security  Users  Manage the Farm Administrators group  Capabilities  No default access to sites or content, but can take ownership Local Administrators  Members of Farm Administrators  Install products or applications, Web Parts, features Service application administrators  Click row of service application (don’t click the link!)  Ribbon  Administrators Service application feature administrators Site collection administrators and site owners

Lesson 2: Administering SharePoint from the Command Line SharePoint and Command-Line Administration Stsadm Introducing Windows PowerShell Demonstration: Windows PowerShell Basics

SharePoint and Command-Line Administration SharePoint v1/v2 (2001–2003):  No command-line interface SharePoint 2007:  Stsadm: 182 Commands (MOSS) SharePoint 2010:  More than 600 Windows PowerShell cmdlets  Superset of Central Administration tasks  Windows PowerShell 2.0 is required Microsoft SharePoint Products Preparation Tool (PrerequisiteInstaller)  Stsadm: Supported but deprecated

Stsadm Included but deprecated  However, a few functions can be performed only with Stsadm Buried in the Program Files folder  C:\Program Files\Common Files\Microsoft Shared\ web server extensions\14\BIN  Add to %PATH% or use SharePoint 2010 Management Shell Command-line administration of SharePoint  Must be run directly on the SharePoint server Command syntax  stsadm –o [-parameter …] Get help  stsadm -help

Introducing Windows PowerShell Command-line and task-based scripting language A framework Easy to learn, use, and adopt Why use Windows PowerShell?  The most powerful Windows-based command-line environment Windows PowerShell vs. Stsadm  Some overlap, but Windows PowerShell has unique capabilities including management of all new features  Install and configure SharePoint 2010  Manage service applications  Granular control of backup and restore

Demonstration: Windows PowerShell Basics In this demonstration, you will learn to use: Windows PowerShell SharePoint 2010 Management Shell cmdlets Tab completion Get-Help Objects Pipeline Aliases Variables

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Demonstration: Windows PowerShell Basics SharePoint 2010 Management Shell cmdlet (Get-Command)  Not case sensitive  Verb-Noun (Action-Object) format Tab completion Get-Help Objects Pipeline ( | ) Aliases (Get-Alias) Variables  $variable = value  String can be with single or double quotation marks  $_ is the current object in the pipeline Windows PowerShell on Microsoft TechNet

Lesson 3: Automating SharePoint Operations with Windows PowerShell SharePoint 2010 Management Shell Delegate Permissions to Use Windows PowerShell Examine the SharePoint Logical Structure Using Windows PowerShell Create a SharePoint Intranet Using Windows PowerShell Objects, Members, Properties, and Methods Select, Sort, and Format Output Filtering Objects Typical Pipeline Variables Iteration (Looping) Iteration in Scripts Local, Global, and Remote Commands Windows PowerShell Scripts

SharePoint 2010 Management Shell SharePoint 2010 Management Shell vs. Windows PowerShell  Windows PowerShell available on clients  SharePoint 2010 Management Shell only on SharePoint servers SharePoint 2010 Management Shell has  SharePoint snap-ins loaded automatically Part of the SharePoint.ps1 profile located in %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\Config\PowerShell\Registration Windows PowerShell: Add-PSSnapin Microsoft.SharePoint.PowerShell  ReuseThread option  Stsadm (/BIN folder) in path

Delegate Permissions to Use Windows PowerShell Requirements to use Windows PowerShell to administer SharePoint  WSS_ADMIN_WPG group on all servers in the farm  SharePoint_Shell_Access database role on database  Note: Setup user (SP_Admin) is not given rights by default Delegate these permissions with Add-SPShellAdmin Add-SPShellAdmin -username -database (Get-SPContentDatabase )  To run Add-SPShellAdmin, you must be securityadmin server role on SQL instance db_owner role for the database Administrators membership on local computer You must also be a site collection owner Set-SPSiteAdministration -OwnerAlias -SecondaryOwnerAlias Management Shell Run as Administrator may be required

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Examine the SharePoint Logical Structure Using Windows PowerShell Examine the SharePoint Logical Structure with Get  Get-SPFarm, Get-SPWebApplication, Get-SPSite, Get-SPWeb Interface vs. Object Model Terminology Using the Pipeline

Examine the SharePoint Structure with Get Get-SPFarm Get-SPWebApplication  Leaves out Central Administration by default -IncludeCentralAdminsitration Get-SPSite  Default limit of 20 -limit all  Always leaves out Central Administration Get-SPWeb  Default limit of 200 -limit all

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Interface vs. Object Model Terminology Tip: Banish the word site from your discussion UI & DocumentationObject Model FarmSPFarm Web applicationSPWebApplication Site collectionSPSite Site, Web site, Web, subweb, subsite SPWeb What Users Say Site

Using the Pipeline Pipeline — perform commands on one or more objects Get-SPSite | Get-SPWeb –limit all Get-SPWebApplication | Get-SPSite -limit all | Get-SPWeb -limit all ? How about with Central Administration ?

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Create a SharePoint Intranet Using Windows PowerShell Cmdlets  Remove-SPWebApplication  New-SPWebApplication  New-SPContentDatabase  New-SPSite  New-SPWeb Create the Intranet Web Application, Site Collection, and Site Create the Intranet Web Application, Site Collection, and Site Create a Content Database, Site Collection, and Site

Create the Intranet Web Application, Site Collection, and Site Remove-SPWebApplication Remove-SPWebApplication -DeleteIISSite -RemoveContentDatabase -Confirm:$false New-SPWebApplication New-SPWebApplication -Name "Contoso Intranet" -Port 80 -HostHeader "intranet.contoso.com" -URL " -ApplicationPool "SharePoint Web Applications" -ApplicationPoolAccount (Get-SPManagedAccount "CONTOSO\SP_Service") -DatabaseName "WSS_Content_Intranet" New-SPSite New-SPSite -Url " -ContentDatabase WSS_Content_Intranet -Name "Contoso Intranet" -OwnerAlias "CONTOSO\SP_Admin" - Template "BLANKINTERNET#1"

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Create a Content Database, Site Collection, and Site New-SPContentDatabase New-SPContentDatabase -Name WSS_Content_Intranet_Sales -WebApplication New-SPSite New-SPSite -Url " -ContentDatabase WSS_Content_Intranet_Sales -Name "Sales" -OwnerAlias “CONTOSO\SP_Admin“ -Template "STS#0" New-SPWeb Get-SPWebTemplate New-SPWeb " -Name "Sales Execs" -Template “BLOG#0"

Objects, Members, Properties, and Methods Cmdlets output objects Objects can be stored in variables for later use or piped to a subsequent cmdlet for use as input by the cmdlet Objects have members: properties and methods A special kind of property is a collection Get-Member object | Get-Member object | Get-Member –MemberType Methods object | Get-Member –MemberType Properties

Select, Sort, and Format Output Write-Output  Writes object to the console: The default “end of pipeline” command  Default properties are displayed Select-Object (alias: Select)  Select * displays all properties  Select PropertyName [,PropertyName…] displays specific properties Get-SPWebApplication " | Get-SPSite -limit all | Get-SPWeb -limit all | Select URL,WebTemplate Sort-Object (alias: Sort) Get-SPWebApplication " | Get-SPSite -limit all | Get-SPWeb -limit all | Sort URL [-descending] Format-Table, Format-List (alias: fl) Export-CSV, ConvertTo-XML, Out-GridView

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Filtering Objects Where-Object (alias: Where, ?)  Filters objects in the pipeline and passes only the filtered objects down the pipeline to the next cmdlet Get-SPWebApplication " | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL | Where-Object { $_.WebTemplate -eq "BLOG"}  Server-side filtering (-Filter parameter) for specific properties: SPWeb: Title and Template SPSite and SPSiteAdministration: Owner, SecondaryContact, LockState Use -Filter parameter (rather than Where-Object cmdlet) when possible Get-SPWebApplication " | Get-SPSite -Limit All | Get-SPWeb -Limit All -Filter {$_.Template -eq "BLOG"} Operators

Comparison operators -eq -- Equal to -ne -- Not equal to -lt -- Less than -le -- Less than or equal to -gt -- Greater than -ge -- Greater than or equal to -like - Like; uses wildcards for pattern matching Logical operators -and -or

Typical Pipeline Get objects | Filter objects (Where) | Manipulate | Select | Sort | Format/Export/Out/Convert/Save Get-SPWebApplication " | Get- SPSite -Limit ALL | Get-SPWeb -Limit ALL | Where-Object { $_.WebTemplate -eq "BLOG"} | Select URL,Title,WebTemplate, LastItemModifiedDate, Created | Sort LastItemModifiedDate | Export-CSV desktop\StaleBlogs.csv

Variables Variables start with $  Assign a variable $username = “CONTOSO\SP_Admin" $password = Read-Host "Enter the password: " - AsSecureString  Use a variable Write-Host "The user name is: " $username Write-Host "The password is: " $password Note: This doesn’t work! Secure, one-way passwords only! Windows PowerShell has built-in variables that you can call at run time  $true, $false  $home  Many more: Get-Help about_automatic_variables

Iteration (Looping) ForEach-Object (%, ForEach) Iterates through each object in the pipeline Sometimes, this is done implicitly by a cmdlet on the receiving side of the pipeline For-Each is helpful where a cmdlet does not do its own iteration Get-SPWebApplication " | Get-SPSite " | ForEach-Object { Enable-SPFeature "Ratings" -url $_.url -whatif } Commonly used alias: %

Iteration in Scripts Syntax ForEach-Object ($variable in $array) { Actions } $i = ("HR", "Marketing") Creating an Array Parentheses are optional here ForEach($url in $i)Iterate through each item in the array Assign $url to the current item {Start loop actions New-SPContentDatabase -Name WSS_Content_Intranet_$url - WebApplication New-SPSite -Url - ContentDatabase WSS_Content_Intranet_$url -OwnerAlias CONTOSO\SP_Admin -Template "STS#0" } End loop actions Blank line starts execution

Notes Page Over-flow Slide. Do Not Print Slide. See Notes pane.

Local, Global, and Remote Commands Two types of commands:  Local (“box”) — must be run on each box Examples: Start-SPServiceInstance, Connect-SPConfigurationDatabase  Global (“config db”) — run only once per farm Examples: Set-SPWebApplication, New-SPSite Remoting  Windows PowerShell 2.0 features Windows PowerShell Remoting  From your machine, perform Windows PowerShell commands and scripts on a remote machine  Think “psexec.exe”

Windows PowerShell Scripts Creating scripts (.ps1)  Windows PowerShell Integrated Scripting Environment (ISE)  Readability Can be multiline or one line: Multiline - Join commands on a single line with ; Can be full cmdlets or aliases: Full cmdlets - ForEach-Object alias is % Execution  Set-ExecutionPolicy -unrestricted  Read up on script signing Schedule a Windows PowerShell script with Task Scheduler  Command: PowerShell.exe  Arguments: path\scriptname.ps1 Scripts you’ll see in this course

Scripts You’ll See Create Web apps, content databases, site collections, and Web sites Create items in a list Activate a feature across multiple site collections Provisioning of managed accounts Back up all site collections in farm

Lab A: Automating SharePoint with Windows PowerShell Exercise 1: Adding SharePoint Functionality to Windows PowerShell Exercise 2: Delegating the Ability to Use Windows PowerShell to Manage SharePoint Exercise 3: Reporting Web and Site Collection Properties Exercise 4: Creating Site Collections Using Windows PowerShell Exercise 5: Creating and Updating Items Logon information Estimated time: 30 minutes

Scenario You are responsible for ensuring that the SharePoint farm can be built consistently in both lab and production environments, and that the farm can be rebuilt in the event of a catastrophic failure. Additionally, you are required to produce weekly reports showing the webs and storage utilization of each site collection in the production farm. To meet these goals, you must build Windows PowerShell scripts that can automate SharePoint management tasks.

Lab B: Administering SharePoint with Stsadm Exercise 1: Executing Stsadm Commands Logon information Estimated time: 20 minutes

Scenario Contoso’s policies encourage and in some cases mandate the automation of common tasks. As such, your Microsoft Office SharePoint Server 2007 environment had several Stsadm scripts that were used to create site collections and webs.

Module Review and Takeaways Review Questions