Microsoft SharePoint 2010 Administration Cookbook Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2011
Production Reference: 1170111
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849681-08-7 www.packtpub.com
Cover Image by David Guettirrez (
[email protected])
Table of Contents Preface 1 Chapter 1: Upgrading and Configuring SharePoint 2010 7 Introduction 8 Checking current installation upgradeability 8 Upgrading MOSS 2007 to SharePoint 2010 11 Upgrading with minimal downtime 18 Visual upgrade 20 Creating and associating content databases to a specific web application and site collection 23 Configuring a content database 26 Creating an Alternate Access Mapping (AAM) 29 Patching (compatibility boundaries) 31
Chapter 2: Service Applications
35
Introduction 35 Managing a service 37 Creating the Secure Store 41 Creating custom security for a service 44 Creating a custom service application proxy group 47 Managing service application associations 49 Setting up Excel Services 51 Setting up PerformancePoint Services 56 Setting up Visio Services 60 Setting up the Managed Metadata Service 63 Establishing a trust relationship between two farms 66 Publishing a SharePoint service 69 Consuming another Farm's Service 72
Table of Contents
Chapter 3: Farm Governance
75
Chapter 4: Site Administration
99
Introduction Administering SharePoint Designer Configuring a Managed account Creating a new policy for a web application Configuring Resource Throttling (large lists) Installing a feature and activating it Restricting web part access in the farm Learning timer job management (including server affinity) Running a timer job on demand Configuring Sandbox functionality
75 76 80 82 85 88 90 92 95 97
Introduction 99 Migrating a site collection 100 Provisioning a site via Windows PowerShell 102 Managing the Term Store 104 Adding a column with the property of Managed Metadata 108 Setting up a site collection policy 111 Configuring a Document Set 113 Configuring multiple Send To connections 118 Setting up an enterprise wiki 121
Chapter 5: Monitoring and Reporting
125
Chapter 6: Search
143
Introduction 125 Accessing the SharePoint 2010 logging database 126 Configuring what gets logged 128 Editing rule definitions in the health analyzer 130 Viewing web analytics reports 133 Troubleshooting with correlation IDs 137 Enabling the Developer Dashboard 139 Introduction 143 Setting up Search Service 144 Managing Search Service 146 Scaling out Search—adding a query component 149 Scaling out Search—adding a property database 152 Scaling out Search—adding a crawl database 154 Adding a host distribution rule 157 Viewing Search Query/Crawl Reports 159 Customizing the refinement menu 161 ii
Table of Contents
Chapter 7: Security Administration: Users and Groups
167
Chapter 8: Content Management
179
Chapter 9: Social Architecture
207
Chapter 10: Backup and Restore
233
Introduction Adding a user via PowerShell Delegating PowerShell permissions Checking effective permission user interface Setting Lockdown Mode for publishing sites Configuring Site Collection audit settings Accessing security policy reports
Introduction Configuring advanced routing (Content Organizer) Routing documents to another site Configuring content deployment Adding a Content Type hub Managing External Content Types Creating a Term Set Importing a Term Set In place Records Management Introduction Setting up a tag cloud and navigating to the Term Store Disabling social features for a user Deleting a note associated with a page Viewing an Activity feed Setting up and compiling an audience Creating a synchronization connection Changing import/export for user profiles Adding a user subtype for user profile Creating a new user profile property
167 168 170 172 174 175 177
179 180 185 188 192 195 198 201 203 207 208 212 214 216 219 222 225 226 228
Introduction 233 Recycle Bin settings in Central Administration 235 Performing a site collection backup 237 Exporting sites 239 Importing sites 241 Recovering data from an unattached content database 242 Backing up a farm in Central Administration 245 Restoring from a backup in Central Administration 249
iii
Table of Contents
Chapter 11: Performance Monitoring
253
Index
267
Introduction 253 Enabling HTTP Request Monitoring and Throttling 255 Using SQL Profiler 258 What and how to monitor with Performance Monitor 260 Implementing Visual Round Trip Analyzer 264
iv
Preface SharePoint 2010 enables businesses to set up collaboration with, and for, many types of entities (employees, vendors, customers, and so on) while integrating disparate technologies. It has proved so valuable a tool at many organizations that its growth has led it to become a mission-critical application. As SharePoint has grown through each version, it has assimilated several technologies. It now encompasses technologies such as content management, Microsoft Access, and Visio to name a few. The administrator's challenge with SharePoint 2010 is recognizing where to perform vital tasks in a product that is as vast as it is deep. The recipes here represent common tasks that an administrator must be knowledgeable about. These are foundational tasks that, in most cases, can be combined and built upon. Features are titled so that even if the task is performed sporadically, you can look at the title and use the book as a reference guide. It is my hope that the book becomes a resource that is referenced often.
What this book covers Chapter 1, Upgrading and Configuring SharePoint 2010, contains recipes that deal with configuring and getting SharePoint up and going. These recipes not only cover upgrading from a previous version but also contain explanations on how to create new web applications and associated components. Chapter 2, Service Applications, covers recipes involving service applications, which is a new concept to SharePoint 2010. These recipes cover the main service applications such as managed metadata and Excel. It also covers the components of a service application, such as custom groups, that can be configured. Chapter 3, Farm Governance, covers different items that relate to managing SharePoint 2010. These recipes will be implemented based on guidance from your organization. The recipes support the rules that govern your organization, such as how to restrict web parts or setting up a managed account.
Preface Chapter 4, Site Administration, contains key recipes for managing the site-level components. Error pages, content types, retention policies, and records management are some of the topics that are covered. Chapter 5, Monitoring and Reporting, covers recipes involving the different tools in SharePoint 2010 that assist the administrator in managing SharePoint. These tools are critical to knowing how the SharePoint 2010 installation operates. The recipes show how to manage the tools. Chapter 6, Search, covers the core components within SharePoint 2010. The topics here range from how to scale out the Search components to customizing search. Search is a broad foundational topic in SharePoint and the recipes here provide a granular view into what an administrator can do. Chapter 7, Security Administration: Users and Groups, contains recipes related to user access. The list of topics range from site collection-level access to site-level access. Chapter 8, Content Management, is about different aspects of SharePoint 2010. These recipes range from term sets, setting up a content type hub, routing documents, to managing external content types. Chapter 9, Social Architecture, is a new topic for SharePoint 2010. The features covered in the recipes have to do with setting up a tag cloud managing the social features for a user. The recipes give the administrator a broad range of where and how the social environment can be managed in SharePoint. Chapter 10, Backup and Restore, is a topic that should be familiar to all administrators. The recipes here cover everything from the recycle bin to a farm backup and restore. Chapter 11, Performance Monitoring, covers some lesser-known ways to monitor SharePoint. The recipes here introduce tools, some of which are not native to SharePoint, but the functionalities they provide assist the administrator without requiring a financial investment. The recipes show how to use these readily available tools.
What you need for this book In order to perform the recipes within this book, a functional installation of SharePoint 2010 Standard is required. SharePoint 2010 is resource intensive on hardware. The recipes in this book have been tested using a laptop with 8 gigabytes of RAM and a 500 gigabyte hard drive. The environment includes Windows 2008 R2, with SharePoint 2010 Enterprise, using SQL Server 2008 R2 Standard. The environment has been created using a native boot virtual hard disk (VHD), which is supported by Windows Server 2008 R2. The configuration that you choose will most likely use some type of virtualization software such as VMWare or Hyper-V. Also you can choose the native boot solution as I have done while writing this book.
2
Preface
The following are the core software components you will need to perform the recipes in this book: ff
Windows Server 2008.
ff
64-bit version of SQL Server 2008 Standard with Service Pack 1. The database engine and tools must be installed.
ff
SharePoint 2010 Enterprise (which comes only in 64-bit).
ff
Virtualization software such as VMWare or Hyper-V.
ff
Visual Round Trip Analyzer.
This book does not cover installation and configuration. In order to perform these tasks, refer to an online resource such as Microsoft's Technet: http://technet.microsoft.com/enus/sharepoint.
Who this book is for If you are a SharePoint Administrator looking for solutions to the many problems faced while managing SharePoint, then this book is for you. This book is written for SharePoint administrators, who are either already working on SharePoint, or have recently started working and are eager to learn more about SharePoint administration. You need to have some basic knowledge of SharePoint in order to follow the recipes in this book.
Conventions In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning. Code words in text are shown as follows: "Create a site collection called sites\ ContentTypeHub, based on the Publishing Site Template, and make yourself the owner." A block of code is set as follows:
Any command-line input or output is written as follows: Get-SPEnterpriseSearchServiceApplication
3
Preface
Errata Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at
[email protected] with a link to the suspected pirated material. We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions You can contact us at
[email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.
5
1
Upgrading and Configuring SharePoint 2010 In this chapter, we will cover: ff
Checking current installation upgradeability
ff
Upgrading MOSS 2007 to SharePoint 2010
ff
Upgrading with minimal downtime
ff
Visual upgrade
ff
Creating and associating content databases to a specific web application and site collection
ff
Configuring a content database
ff
Creating an Alternate Access Mapping (AAM)
ff
Patching (compatibility boundaries)
Upgrading and Configuring SharePoint 2010
Introduction SharePoint 2010 requires 64-bit architecture on the servers, with a minimum of 8 gigabytes of RAM. The result of this requirement is that there will be installations upgrading their 32-bit architecture and then upgrading/migrating their sites. Upgrading SharePoint 2010 is optimally a one time job. In reality, this is not always the case as there may be business reasons one web application is upgraded and another is left in MOSS 2007. This could be due to software integration with SharePoint, components that are not ready for SharePoint 2010, or a segment of users that need time before upgrading to SharePoint 2007. SharePoint 2010 has been architected with the capability to migrate sites methodically. With this in mind, every recipe in this chapter approaches the upgrade from the viewpoint of iterative tasks after an upgrade. This means that a majority of the tasks can be performed several times against different web applications. Every recipe here (except the first one) should be performed and understood by the administrator of the SharePoint 2010 farm. There are many new items in SharePoint 2010 that will become common tasks; some more than others depending on the size of your environment. One of the best new tools that should be in your arsenal is PowerShell. The recipes in this section outline the commands you will need. However, after reviewing and trying these recipes, look at scripting your tasks with PowerShell. This will enable you to become a more effective and proactive IT Professional.
Checking current installation upgradeability In order to upgrade to SharePoint 2010 from your current Windows SharePoint Services 3.0 (WSS) or Microsoft Office SharePoint Server 2007 (MOSS) implementation, you need to plan your new infrastructure carefully. When thinking about planning your new architecture, take into account the logical design and the physical design of the new SharePoint 2010 installation. Issues need to be identified, resolved, and requirements need to be met. Issues can range from addressing 32-bit architecture to custom site definitions. These items need to be resolved before being able to update to SharePoint 2010. Begin your planning by identifying and documenting your current infrastructure. Review the hardware, WSS/MOSS configurations, and potential customizations. A typical farm installation will have multiple servers with diverse roles: web front ends, applications servers, database servers, among others. Extrapolating from there, an installation can have multiple content databases, web applications, site collections, Shared Service Providers, to name a few of the components. 8
Chapter 1
In order to manage your infrastructure and plan for the SharePoint 2010 upgrade, Microsoft has provided organizations with a tool called preupgradecheck. This tool is shipped as part of MOSS Service Pack 2. As long as this service pack is applied, the tool is available. This tool documents the current installation, checks your MOSS/WSS installation against SharePoint 2010 requirements, and applies best practice rules identifying areas of concern.
Getting ready In order to execute this tool, the WSS 3.0/MOSS 2007 installation must have the Office 2007 Service Pack 2 installed. This tool is native to the SharePoint installation and an extension of the stsadm command. You must be a member of the Farm Administrators SharePoint Group, with administrator permissions on the server.
How to do it... 1. Click Start and Run... on the web front-end server. 2. Type in cmd and press Enter. 3. Navigate to c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN. This can be achieved with the help of the CD (Change Directory) command. 4. Type the following in the command prompt: stsadm -o preupgradecheck
You should see a report that looks similar to the following screenshot:
9
Upgrading and Configuring SharePoint 2010
How it works... The pre-upgrade application leverages rules that can be found in the following two files: OssPreUpgradeCheck.xml and WssPreUpgradeCheck.xml. These files were created in 12\CONFIG\PreUpgradeCheck when the Microsoft Office SharePoint 2007 Service Pack 2 was installed. Refer to the next screenshot:
In the command prompt window shown in step 4 of the previous section, a summary of the operations is shown. The objects marked with the colors yellow and red must be addressed. The farm will not get upgraded until objects in red color are addressed. As you can see from the preceding screenshot, an HTML file is created in the 12\Logs folder, which contains the information the pre-upgrade application produced. The first part of the report produces important information as shown in the following screenshot:
10
Chapter 1
Other information collected includes the SharePoint version, supported upgrade types, along with information on your servers, including roles, amount of data, number of web applications, site collections, and number of servers. The rest of the HTML report lists the checks that were done and any issues that were found. If an issue is found, the report will include a description on fixing the issue or a link to a Microsoft Knowledge Base article that corresponds to the issue.
There's more... The pre-upgrade application performs read-only operations against the database. No changes are made to your SharePoint installation. This means you can run the application multiple times and there is no adverse effect on your SharePoint installation. As you resolve issues, it is advisable that you rerun the pre-upgrade application.
More info Using the preupgradecheck rule files parameter, you can create your own custom rules to identify items that are specific to your installation.
Upgrading MOSS 2007 to SharePoint 2010 There are two approaches to upgrading your WSS 3.0/MOSS 2007 farm to SharePoint 2010. They are: ff
In-place upgrade: This is where you will upgrade your current installation on the hardware it currently resides on.
ff
Database attach upgrade: To perform this type of upgrade, you must have a new SharePoint 2010 farm up and running. You will take the content databases from the MOSS 2007 farm, attach them to the new farm, and upgrade them.
The latter method of upgrading your MOSS 2007 farm is the preferred method and the one that this recipe outlines. It has many advantages over the in-place upgrade method. Some of these advantages are: ff
It leverages backup and restore through SQL Server Management Studio. SharePoint IT Administrators should already be familiar and comfortable using these tools.
ff
The addcontentdb stsadm command should already be familiar to many SharePoint Administrators. It creates a new content database or as in the case outlined in this recipe, adds a database that needs to be upgraded. Attaching a database reduces the downtime of your SharePoint installation. This reduces the pain your customers will feel and enhances the success and acceptance of your upgrade.
ff
You can perform the upgrade in an iterative fashion, or even in parallel. The in-place upgrade is a one-way, don't-look-back upgrade. 11
Upgrading and Configuring SharePoint 2010 ff
You can have granular control over the steps of your upgrade. You control what gets upgraded, when, and how. This allows for flexibility, which is the key to a successful upgrade.
SharePoint 2010 has a completely different Services architecture as compared to MOSS 2007 Shared Services. This new architecture must be planned carefully and implemented according to the organization's needs. By doing a database attach, your farm will correctly consume the new architecture as architected.
Getting ready The preupgradecheck should already have been run on your current installation and any issues should have been resolved. Be sure to identify the content database that is being upgraded. A new SharePoint Server 2010 farm must be set up and configured using a web application. You must have access to SQL Management Studio with the ability to create databases.
How to do it... 1. Log in to the WSS 3.0/MOSS 2007 database server. 2. Open Microsoft SQL Server Management Studio and connect to the database server hosting the SharePoint content database. 3. In the Object Explorer, click on the folder named Databases. 4. Find the identified content database. By default, this is called wss_content_ {guid}. The {guid} is a unique number generated when the database is created but it may not be present. 5. Right-click on the content database and select Tasks | Back Up. A screen similar to the following screenshot appears:
12
Chapter 1
6. Ensure Backup type is set to Full. Also the Name and Destination field should be populated correctly. 7. Click OK. The file should be backed up successfully after a period of time. 8. Ensure the backup is accessible to the SharePoint 2010 database server. If the SQL Server is physically not on the same server as SharePoint, copy the backup to the destination server where it is accessible. 9. Through SQL Server Management Studio, connect to the SQL Server instance where the SharePoint 2010 databases are installed.
13
Upgrading and Configuring SharePoint 2010 10. In the Object Explorer window, right-click Databases. Navigate and click on Restore Database. The following screenshot appears and must be filled with appropriate values:
Fill in the To Database textbox. Choose the backup file in the From Device option. Check the Restore option under the Select the backup sets to restore option. Click OK.
11. After the content database is successfully restored, it must be added to the SharePoint 2010 Web Application using addcontentdb, which is an argument to the stsadm command. 12. Open a command window. Make sure to run it as administrator when you open it. If you right-click on the command prompt, there is an option provided to Run as Administrator. 13. Type in the following command: stsadm –o addcontentdb –url
-databasename
14
Chapter 1
Here is the screenshot I get when I run this command:
14. When the operation finishes successfully, navigate to the SharePoint 2010 Central Administration site. 15. Click the Application Management option. Under Site Collections, click the Change Site Collection Administrators option. 16. Ensure that there is a valid site collection administrator. Navigate to the new site.
How it works... Steps 1 through 7 showed how to take a backup of the content database that was being upgraded. Step 8 is copying the physical file that is created from the backup to the new server. Using file storage and rights, the file may not have to be copied. The important part of this process is that the new SQL instance for SharePoint 2010 has access to this file. Steps 9 through 11 performed a restore to put the backup file into the new SQL database instance. Steps 12 through 14 ran the command that performs the physical upgrade of the file. An upgrade of the content database is nothing more than schema changes, table changes, and stored procedure changes. It also adds the content database to the specified web application. In steps 15 and 16, we, as Farm Administrators, ensured that the Site Collection Administrator from MOSS 2007 is still a valid account in the now upgraded SharePoint 2010 farm. The database attach method is the least intrusive upgrade when it comes to your SharePoint Farms. For SharePoint 2010, upgrading with addcontentdb can be done only through the stsadm command; its functionality is not found in the Central Administration User Interface. Finally, there is a parameter called preserveolduserexperience in the addcontentdb command. This is an optional parameter and set to true by default. When the site is upgraded to SharePoint 2010, it will contain the same look as it did in MOSS 2007. If you want the site to use the new SharePoint 2010 look, then ensure that you use this parameter and set it to false. Depending on the farm architecture, you may have more than one content database per web application. In a case such as this, it is more efficient to upgrade both simultaneously. This is accomplished by doing multiple attaches in parallel. Instead of using the addcontentdb command, use PowerShell and the Mount-SPContentDatabase command. 15
Upgrading and Configuring SharePoint 2010
There's more... Before adding the content database to the web application, there is an additional tool that has been added via SharePoint's PowerShell commands. This tool confirms that the new web application has all the necessary components to support the upgrade. It functions by comparing the database you are about to attach/upgrade against the web application you wish to attach. The command is Test-SPContentDatabase. 1. Click Start | All Programs. Select Microsoft SharePoint 2010 Products and then SharePoint 2010 Management Shell. Refer to the following screenshot:
2. At the command prompt, type in the following command: test-spcontentdatabase –name webapplication
This command will produce a report in the window that can be piped to a file through PowerShell. The report will identify issues such as missing site definitions, features, or assemblies. The benefit of this command is that it works read-only against your web application so that it can be run iteratively. As you resolve issues, you can rerun the command. Keep this command as part of the IT Professional toolkit. It is very useful to scan and identify issues against WSS 3.0/MOSS 2007 and SharePoint 2010 databases.
More info—further upgrade info After the upgrade and migration is complete, you will see a successful or unsuccessful indicator in the command prompt. However, the best place to view the status of your upgrade is in Central Administration. This is especially true if there are parallel upgrades happening. 1. Open the SharePoint 2010 Central Administration site. 2. Click Upgrade and Migration. 3. Click Check Upgrade Status. There will be a screenshot similar to the following:
16
Chapter 1
As can be seen in the preceding screenshot, there were two upgrades that took place. One failed and one succeeded. One of the items on the report is the location of the log file, which shows detailed information about the failures. There is also a custom error log file created that is necessary to look at when there are errors in the upgrade. Also, there is a category named Remedy. In here is located a hyperlink to a possible resolution for the issues found.
More info—errors when upgrading There are times when the upgrade fails. If that occurs, you may see a screen similar to the following:
When this occurs, you are directed to the log file in order to determine what the issue is and how to go about resolving it.
17
Chapter 1
7. Change the Database Read-Only property to True from the existing value of False. 8. Click OK.
How it works... Once the content database is read-only, no changes can be saved to the database. The WSS 3.0/MOSS 2007 site is still available to query information to the entire user population. The database can now be backed up with confidence in the integrity of the data state. The database can be copied to the new SharePoint 2010 SQL Server and upgraded as shown in the previous recipe. When the new environment is ready to go, perform an Alternate Access Mapping (AAM) redirect to route users to the new environment and detach the database in SharePoint 2007. This is referred to in Microsoft Technet as a Hybrid upgrade.
19
Chapter 1
3. A screen is presented with three options:
Display the Previous SharePoint user interface Preview the new SharePoint user interface (it can be rolled back if there is a problem) Use the new SharePoint user interface (this is permanent)
Choose the Preview… option. 4. The site is now presented with the new SharePoint 2010 UI. 5. To roll the site back or commit the site to the new UI, click Site actions | Visual Upgrade. Choose either of the options: Display the Previous SharePoint user interface or Use the new SharePoint user interface.
How it works... SharePoint 2010 ships with the MOSS 2007 master pages, application pages, and CSS files. It provides the facility to convert those deprecated layouts to the new UI through the visual upgrade. This makes sure organizations do not have to make the visual leap to SharePoint 2010 all at one time. It can be phased in and tested properly, ensuring all the UI assets and UI changes function correctly.
21
Upgrading and Configuring SharePoint 2010
There's more... The visual upgrade can also be done at the site collection level through the administration page. This will allow the site collection administrator to apply the SharePoint 2010 UI to all sites under the Site Collection or hide the visual upgrade from the site owners. The caveat to doing an upgrade to all sites is there is no preview. Any issues that result in the new UI must be dealt with immediately. There is no changing back to the MOSS 2007 pages. The steps to achieve this are: 1. Click Site Actions, Site Settings. 2. Under the Site Collection Administration, there is an option for visual upgrade. The screenshot is the screen we get:
Choose either of the following options: Hide Visual Upgrade or Upgrade All Sites.
More info—changing UI version with PowerShell There are times when a visual upgrade must be rolled back after it has been committed. This may be due to issues with the ribbon or CSS styling. In any event, the upgrade has been made and now the company wants to roll it back. Using PowerShell, it is possible to change the look back to MOSS 2007. Use the following snippet to change the look back for a single site: $web = Get-SPWeb http://server/site $web.UIVersion = 3 $web.UIVersionConfigurationEnabled = $true $web.Update()
22
Upgrading and Configuring SharePoint 2010 2. At the top of the resultant page is the Add a content database option. Click the option and the following screenshot will be displayed:
3. The database name is given a GUID suffix by default. Change the database name to be relevant but use a naming convention. In the case of the preceding screen, I will change database name to WSS_Content_Marketing. Keep the rest of the defaults and click OK. The content database will be created and listed under Manage Content Databases. 4. To ensure that the site collection gets added to the proper content database, ensure that you are still under Manage Content Databases. 5. Click on the content database(s) you don't want the site collection to get added to. 6. Under the Database Information settings, set the Database status to Offline. Click OK. Refer to the next screenshot:
24
Chapter 1
7. Navigate to Application Management, then Site Collections. Under this section, click Create site collections. 8. Fill the information for Title, URL, select a template, and include a primary site collection administrator. Click OK. 9. The site collection should be created and added to the appropriate content database. To check this, navigate back to the Manage Content Databases screen. See the example shown in the following screenshot. WSS_content_7777 is Stopped (offline) and the new site has been added to WSS_Content_Marketing.
10. Reverse the action from step 6 and put the content database back in Ready state.
How it works... The first half of the procedure is self explanatory. We are creating a content database under the appropriate web application. The second half of the procedure takes the database offline. This action will ensure that the next site collection cannot be added to that database. The action of assigning a site collection to a content database is very similar to network load balancing. The site collections are assigned quite evenly across the content databases while they are online.
There's more... When doing a SharePoint 2010 upgrade of multiple content databases, ensure that the first content database that you add contains the root site for the associated web application. The rest of the content databases for the web application can be added in any order afterwards.
25
Upgrading and Configuring SharePoint 2010
More info There will be times when you do not want to add any more site collections to a content database. In order to accomplish this, perform the following steps: 1. In Central Administration, under the Databases section, click on the Manage Content Databases option. 2. Click on the database that you wish to no longer add site collections to. 3. Change the Maximum number of site collections settings (under Database Capacity Settings) to be equal to the current number of site collections. 4. Change the Number of sites before a warning event is generated setting to be one less that the current number of site collections.
More info You have seen how to do this recipe through the user interface. There is a way to do the same procedure through scripting. PowerShell is the new way of scripting, but the stsadm command set is still available. Here are both methods: ff
Using stsadm command: stsadm –o createsiteinnewdb –url -owneremail <email> -ownerlogin <domain/name> -sitetemplate <site template> –title -databaserver <serverdb> -databasename
ff
Using PowerShell, we need to run the following two commands: New-SPContentDatabase New-SPSite
Configuring a content database In SharePoint 2010, content databases are the heart of an organization's data. This is where all the site content information, such as documents, list data, and web part properties, is stored. By default, the content database is set up with parameters that may not be optimal to your organization. Thankfully, these parameters can be changed and tweaked to fit your installation. It is important to note what can be changed and the ramifications of the change. In this recipe, you will be exposed to the parameters and the possible changes that can be made.
26
Upgrading and Configuring SharePoint 2010 ff
Failover Server: This is a new option within SharePoint 2010. Entering a server name into this box will not set up the failover server. It tells SharePoint what failover database server to utilize in the event one is needed. Refer to the following screenshot:
ff
Database Capacity Settings: This section controls the number of site collections that will be created within the content database. There is a warning level, which must be at least one less than the maximum number of sites that can be created. Refer to the following screenshot:
ff
Search Server: The content database will utilize a search server. Depending on your environment, there may be more than one server in this drop down.
ff
Remove Content Database: This section allows the administrator to disassociate the content database from the web application. It does not delete the content database from the SQL Server. The data is still available and untouched. Any content in the site collections, contained in the content database, will no longer be accessible. Refer to the next screenshot:
ff
Preferred Server for Timer Jobs: In SharePoint 2010, we can dedicate a server for timer jobs. This server would be indicated here for the content database. Refer to the following screenshot:
28
Upgrading and Configuring SharePoint 2010 3. There is a drop-down list at the top that allows you to select whether to look at the whole farm or only the components on a particular server. A part of the report looks like the following screenshot:
4. Navigate back to Upgrade and Migration and select Review database status. A report is displayed, detailing all the databases for the Farm and their status.
5. Navigate to Application management | Databases | Manage Content Databases. 6. Click on a content database. The second section is called Database Versioning and Upgrade. It details the database schema versions and looks as shown in the next screenshot:
32
Chapter 1
How it works... The recipe shows three components of the patching story. Together, these components provide a comprehensive view to the administrator of the SharePoint Farm. Utilizing this information, the administrator can make informed decisions as issues are brought up, and can decide if a new patch must be applied. The three components are: ff
Patch Status: This shows the patch level of the servers. If there is something missing or required, it will be flagged with a hyperlink to the patch that is needed.
ff
Database Status: This is a listing of all the databases in the farm including SQL instance. With SharePoint 2010, there are many databases and they can be run in a compatibility range. Under status, there will be a message letting the administrator know what is required or what is happening.
ff
Database Schema Versions: This shows the current schema version and the maximum schema version that the database can be updated to.
There's more... SharePoint 2010 monitors the health of your farm using a set of rules that are programmed against best practices. An administrator can review these rules and run them on demand or change their schedule. When a rule is broken, the issue is flagged and a red bar with a hyperlink to view the issues will appear on the Central Administration home page. These are found under Central Administration, under a section called Monitoring. In that section is a Review rule definitions hyperlink. The rules for patch management can be found under the section Configuration. Refer to the following screenshot:
33
Upgrading and Configuring SharePoint 2010
More info PowerShell is a powerful enabler for the SharePoint Administrator. There are three commands that are applicable to this process. ff
To produce a listing of all the patches on the server: Get-hotfix
ff
Return a listing of content databases and their GUIDs: Get-spcontentdatabase
ff
To upgrade the database: Upgrade-spcontentdatabase –id
34
2
Service Applications In this chapter, we will cover: ff ff ff ff ff ff ff ff ff ff ff ff
Managing a service Creating the Secure Store Creating custom security for a service Creating a custom service application proxy group Managing service application associations Setting up Excel Services Setting up PerformancePoint Services Setting up Visio Services Setting up Managed Metadata Service Establishing a trust relationship between two farms Publishing a SharePoint Service Consuming another Farm's Service
Introduction SharePoint 2010 introduces an overhaul of the MOSS 2007 Shared Service Provider (SSP). It is such a significant paradigm change that those who are responsible for implementing SharePoint must understand architecting to a different level. MOSS 2007 had the SSP. The SSP encapsulated Search, Excel Calculations Services, user profiles, and the business data catalog. This is a "box" of services. This box was limited because you could not break it apart. One of the reasons it was limited was the fact that the services within affected the whole farm. If Accounting wished to use Excel Calculation Services, the whole farm was affected, even those not using it. In addition, writing an integrated custom service was out of the question.
Service Applications SSPs are gone in SharePoint 2010. Microsoft has taken the SSP concept and built a new service application infrastructure that is flexible, extensible, and scalable: ff
Flexible: Services can be segmented to a particular group of users providing security boundaries. They can also be consumed by a subset of groups. For instance, Accounting and Engineering could share an instance of PerformancePoint Services. Legal is unaffected and cannot consume the work the other two groups are doing.
ff
Extensible: Custom services can be written and "bolted" onto the existing architecture. An example of this is PowerPivot. It provides its own service that utilizes the existing architecture.
ff
Scalable: Services are the application layer of SharePoint. As resources are consumed, more boxes may be necessary to scale properly. The service architecture provides for this possibility.
Service applications for SharePoint 2010 can be viewed very similarly to the cable TV paradigm. With cable TV, we have a lot of channel choices and they are presented to us in packages. It becomes a decision as to what package you wish to consume. Premium content costs more and includes channels such as HBO. There is basic cable that typically includes local channels showing programs that are created at a city level; high school football team games would be an example of this. Basic cable is comparable to the service applications in SharePoint Foundation. By paying a very little amount or nothing at times, you are able to get basic functionality such as Business Connectivity Services. Moving up to SharePoint Standard is akin to having stations such as TBS, AMC, and so on. It is the middle tier of packages. In our scenario, this is services such as Managed Metadata and Search, which can be subscribed to via different server farms. Applications such as Excel Services and Visio are comparable to the premium content such as HBO, as these applications come bundled only with the enterprise version of SharePoint. There are three tenets that you must know when architecting and supporting service applications. ff
Services included in the different versions of SharePoint
ff
Services dependent on the others
ff
Services that can be shared across farms
The following diagram summarizes the versions and some of the characteristics:
36
Chapter 2
Other products such as Office web applications, Project Server, and PowerPivot ship their own services applications. Most service applications use their own application pool, under which their web service runs. One of the positive effects of this structure is if something goes wrong with that service, it will not affect the rest of the farm. Another positive effect is the ability to implement least privileged accounts. The factor to keep in mind when creating application pools is the amount of resources that they consume—in particular, RAM. When installing SharePoint 2010, certain configurations are set by default using wizards. We assume no wizards in any of these recipes.
Managing a service In order to manage a service application, the Farm Administrator or service application administrator will either administer through the Central Administration website or through PowerShell. There is a Manage Service Applications page that lists all the services running on the farm that you have rights to manage. This will be clearly shown in the recipe you are about to follow. 37
Chapter 2
When navigating to this page for the first time, the administrator can perform several operations from the ribbon. You can create or edit an existing service application or connect to another farm's service application. The key is to pay attention to the ribbon at the top and to the innate visual cues. Depending on what is clicked, different ribbon components will light up. This is known as being context sensitive. 3. Navigate to a Service Application's administration page by clicking on the service name. For instance, hover your cursor over the Managed Metadata Service, and it will be underlined as shown in the next screenshot:
When you click on the service application name, the respective management page is loaded. 4. Another way to manage the components of the service is to click to the right of the service application name. The entire line item becomes highlighted in blue as seen here:
5. Observe the ribbon. All the features are now lit up as seen in the next screenshot:
Prior to this step, the only action we could perform from the ribbon was to create a new service application or connect to a service application that has been published. Now we can: ff
Delete a service application.
ff
Manage a service application. This brings us to the same page that step 4 brought us.
ff
Assign Administrators to manage this service application. This is called delegation.
ff
View and edit the Properties of the service application.
ff
Publish the service application for another farm to be able to consume its services.
ff
Assign Permissions to accounts that can access the service application. 39
Service Applications
How it works... The Manage Service Application page will show you all services you can manage in the farm and their status. If you do not have the rights to manage a service application, it will be security trimmed from your view. The service application itself is listed first. Underneath it, indented, is the service application proxy that connects a consumer of this service from the web front-end to the service application. A service application may have one, more than one, or all of the following components: ff
Database(s)
ff
Administrative page
ff
Application pool
ff
A running physical instance
Only the services that have been installed will be listed on the page. Finally, the services that will be available depend on the version of SharePoint that is installed.
There's more... Shared services make use of Windows Communication Foundation (WCF). As such, when the service applications are started, if you look in IIS, there is an associated web service provisioned in the virtual directory called SharePoint Shared Services. Expanding this directory you will see each service in the guise of a GUID. This GUID is not very helpful. Right-click on a GUID, navigate to Manage Application, and then Advanced Settings. You will see the next screenshot:
As Physical Path, you can see the service that is associated with the GUID. You can also see that all services reside in the C:\Program Files\Microsoft Office Servers\14.0\ WebServices\folder.
40
Service Applications Create an Active Directory account, which will be configured as the identity for the application pool created for this service application.
How to do it... 1. Open up the SharePoint 2010 Central Administration website. 2. Under the section titled Application Management, click Manage service applications. 3. On the ribbon, in the top left corner, is a New button. Click the arrow to see all the services that can be created. Select the Secure Store Service option as seen in the following screenshot:
4. A form appears with the following fields to be filled in:
Name: Fill in the Service Application Name.
Database Server: SQL Server machine name.
42
Database Name: The name of the Secure Store database to be created. You can modify the GUID at the end of the name. Database Authentication: Choose the Windows authentication radio button. Failover Database Server: Fill this in if you have a server configured for this operation. This will not create a failover database. Application Pool: Create a new application pool and give it an appropriate name. Associate a security account: Use configurable and an existing domain account that was created as part of the requirements.
Chapter 2
Audit Log: By default, this is enabled and the textbox is populated with the default value of 30 days.
Click OK. The Secure Store application will be created and the page will navigate back to the listing of service applications. 5. Once the new Secure Store Application is created, click on it. 6. A key must be generated to encrypt the database. This is done based on a pass phrase. The pass phrase must be at least eight characters long and must have at least three of these four elements—uppercase characters, lowercase characters, numeric characters, and special characters. The following screenshot shows the presentation screen:
7. Click OK after filling in the Pass Phrase and the Confirm Pass Phrase textbox. The service is now operational.
How it works... At the heart of the Secure Store service is the Secure Store database that will contain credentials to be used for accessing external data sources. These credentials are encrypted and decrypted via the key that was generated when the pass phrase was created. The information that is filled out in step 4 is the identity of the database, the authentication method, the application pool it uses, and a potential Failover Database Server. The failover database server would need to be set up independently as identifying a server as failover does not configure it.
43
Service Applications
There's more... PowerShell can be used in place of the UI to create the Secure Store service application. Before creating a new Secure Store service application, ensure that the Secure Store service is running. This can be confirmed by doing the following: 1. Open Central Administration. 2. Click System Settings. 3. Click Manage Service on Server under the Server section. 4. Ensure the Secure Store Service says started.
Using the following PowerShell command, we can create the Secure Store Service application: New-spsecurestoreserviceapplication –Name $serviceapplicationame –partionmode: –sharing:$false –databaseserver $dbserveraddress –applicationpool –administrators –auditingenabled:<true> auditlogmaxsize 30
Using the following PowerShell command, we can generate/refresh the key: Update–spsecurestormasterkey –serviceapplicationproxy <proxy> –passphrase Update-securestoreapplicationserverkey –serviceapplicationproxy <proxy> –passphrase
Using the following PowerShell command, we can get a listing of running services: Get-SPServiceInstance
More info The encryption key should be backed up because you may need to use it again in case you have to restore a backed up Secure Store database or if you add a new application server to the farm.
Creating custom security for a service With the advent of the service applications and their innate standalone nature, Farm Administrators have the ability to delegate responsibility on a per service basis. No longer is the Farm Administrator the only person managing the SharePoint deployment and, as a consequence, becoming a bottleneck for the organization.
44
Chapter 2
In this recipe we can see that services can be assigned to the responsible party. The Central Administration UI will show only the pages for which the Server Administrator has rights. As an example, search is a critical component to many SharePoint 2010 installations and typically there is a Subject Matter Expert who would be the administrator of this service. Now that person can be assigned the role and that is the only search service they will have access to administer.
Getting ready You must have Farm Administrator rights or be an administrator of the service to perform this action. The service you choose must be started and configured. Create an Active Directory account that will be configured as an administrator for the Service Application.
How to do it... 1. Open Central Administration and click the Application Management option. 2. The third section is Service Applications, click Manage Service application. 3. Navigate to the service on which you are going to delegate authority. You can do this by finding the Service application and clicking to the right of the name. The whole line will be highlighted as seen in the next screenshot:
4. When the whole line is highlighted, the ribbon lights up as seen in the next screenshot:
45
Service Applications 5. Click on the button named Administrators. An input form will be displayed.
The first box is the people picker box. Here, you will type in the name of the person you wish to administrate the service application. By clicking the check icon, the system will validate the user. You can also click the book icon and use the people picker. 6. After the administrator(s) are chosen, click the Add button. The Permissions box will dynamically be populated showing the level of control. 7. Finish the process by clicking OK at the bottom of the form. The administrators are now assigned.
How it works... When a domain user account is granted permissions to a service application, they are given the rights to manage the associated service. From an administrative view, this is empowering to the user and takes the responsibility from IT. In addition, the user will be able to navigate to the Manage Service Applications web page, but will be granted rights to only those services for which they have permissions. The user will have access to these services through Central Administration. They will be shown a subset of the Central Administration User Interface. The user will not see any other services, nor will they be able to manage any other services through PowerShell.
46
Service Applications
How to do it... 1. Click the Start button on the WFE. 2. Under All Programs, navigate to the Microsoft SharePoint 2010 Products folder. 3. Right-click on SharePoint 2010 Management Shell and click Run as Administrator. The PowerShell console will appear. Type in the following command: New-spserviceapplicationproxygroup –name SAPGFinancial
4. The service application proxy group is created after submitting.
How it works... Service application proxy groups are the ambassadors of the service application technology. They match web applications to the associated service application proxies. In this way, web applications are consuming only those service applications that they have access to. An application proxy group can contain multiple service applications, even of the same type (for example, two instances of Excel Services). Refer to the following diagram:
There are two web applications utilizing the same proxy group. The proxy group routes them to their service application proxy group. In this case, there are two managed metadata service applications. 48
Service Applications
How to do it... 1. Open Central Administration and click Application Management. 2. The third section is Service Applications. Click the Configure service application associations option. You will see a screenshot similar to the following:
3. Click on the SAPGFinancial group option. A pop up will appear that will enable you to choose the service applications you want to associate with this application proxy group.
50
Chapter 2
Name: This is the name for the service application. Name the Service Application as ExcelService Finance.
Application Pool: Create a new application pool here or use an existing one.
Configurable: This is a domain security account for the application pool.
Check the Add to default proxy list option. Refer to the Creating a Custom Service Application Proxy group recipe. For this recipe, check the box so that it will be tied to the default.
5. Ensure that there is a running Secure Store Service by checking that the service is started on the Manage Service Applications page. If it is not, follow the Creating the Secure Store recipe. 6. Set up the unattended service account in the Secure Store. Click on Application Management and then select Manage service applications. 7. Navigate to the Secure Store Service and click on it. It should appear as a hyperlink. 8. The screen that displays is where we create the Target Application Settings. Click New on the ribbon. You will be presented with the following screen:
9. Fill in the fields as follows:
Target Application ID: CBExcelServices
Display Name: Cook Book Excel Services
E-mail: Use an e-mail address from your domain
Target Application Type: Change to Group from Individual that is set by default Target Application Page URL: Select the None option
10. Click Next. 53
Service Applications 11. The next screen displays the fields that will be stored in the target application. Leave them as they are and click Next. 12. Finally, the administrator and members of the group must be input via the following screen:
Target Application Administrators: Enter the user who will have administrator access.
13. Click OK. 14. Now a user credential needs to be set up for this target application. Click Set Credentials on the ribbon with the CBExcelServices option checked. Refer to the following screenshot:
15. The next screen needs the credential users for Excel Services. Enter the following information:
Credential Owner
Windows User Name
Windows Password / Confirm Windows Password
Click OK. 16. On the Manage Service Applications page, click to the right of the service application called ExcelService Finance. The ribbon at the top will light up. Note that the Service Application is the left-aligned object, whereas the Service Application Proxy is the indented object with the same name. 17. Click the Manage option on the ribbon. The following screenshot will appear for configuration: 54
Chapter 2
18. Click Global Settings. 19. The Excel Service setting form will appear. At the bottom, there is a spot to fill in Application ID for the unattended service account. Use the account that was set up in step 6.
20. Click OK.
How it works... The first important milestone in our recipe happens after Step 4. When we fill out this form and click the Create button, the Excel Services Application and associated service proxy are created and started. In SQL, a database is created and now the web front-end and the application server can communicate using web services (WCF). Refer to the Managing a service recipe for the explanation on the web service. In Step 16, we needed an unattended service account for the ExcelService Finance Service Application. This account gives us the ability to access our back-end data that is utilized in our workbooks. This is set up in steps from 5 through 12. I want to point out that in step 8, there is a Target Application Type setting; for this recipe, we choose Individual. We could have chosen group, which is the current recommendation. The advantage of doing this is that we can create a group in Active Directory and apply it to our unattended service account. Then, we only need to manage the users in that group instead of coming back to the Secure Store. Group management is the preferred method, most of the time.
55
Service Applications
Name: This is the name for the service application. Name the Service Application as PPS Finance.
Check the Add this service application's proxy… option.
Application Pool: Create a new application pool here or use an existing one.
Configurable: This is a domain security account for the application pool.
5. Click on the Create button. 6. Ensure that there is a running Secure Store Service by checking that the service is started on the Manage Service Applications page. If it is not, follow the Creating the Secure Store recipe. 7. On the Manage Service Applications page, click to the right of the PerformancePoint service application called PPS Finance. The ribbon on the top will light up. Note that the Service Application is the left-aligned object, whereas the Service Application Proxy is the indented object with the same name. 8. Click the Manage option on the ribbon. The following screenshot will appear for configuration:
9. Click the PerformancePoint Service Application Settings option. 10. Fill in the data for the Secure Store Service Application and Unattended Service Account option. Click OK.
11. Open up your SharePoint website. This will be the site that is associated to the web application where PerformancePoint has been set up. 12. Click Site Settings. 13. Under Site Collection Administration, click the Site Collection Features option. 58
Chapter 2
14. Click on the Activate button on SharePoint Publishing Infrastructure:
15. Navigate back to Site Settings (Step 11). Click Manage site features under Site Actions. 16. Click on the Activate button on PerformancePoint Services Site Features.
How it works... This was a coordinated series of steps that activated many moving parts in our SharePoint installation. It is important to understand what was done under the covers. The first important milestone in our recipe happens after Step 4. When we fill out this form and click Create, the PPS Application and associated service proxy are created and started. In SQL, a database is created and now the web front-end and the application server can communicate using web services (WCF) to the database. Refer to Managing a Service recipe for the explanation of the web service. In Step 9, we needed an unattended service account for PPS Finance. This account gives us the ability to access our back-end data that will be shown in our dashboards and utilized in our KPIs and scorecards. Finally in Steps 13 and 15, we activated the features necessary on our site to utilize PerformancePoint Services. The first feature was the publishing infrastructure. This is necessary as it provides publishing components that are necessary for the Business Intelligence Center. The second feature was the PerformancePoint components that are utilized. These are the PerformancePoint content types, web parts, and a Business Intelligence Center site template found under Enterprise. Here is an example of the content types that are created:
59
Service Applications
Check the Visio Graphics Service Application Proxy option to put it in the default proxy group.
Once you are done filling the required data, click OK. 5. Ensure that there is a running Secure Store Service by checking that the service is started on the Manage Service Applications page. If it is not, follow the Creating the Secure Store recipe. 6. Set up the unattended service account in the Secure Store. Refer to the steps from 5 through 12 of the Setting up Excel Services recipe. 7. On the Manage Service Applications page, click to the right of the Visio Graphics service application called Visio Finance. The ribbon at the top will light up. Note that the Service Application is the left-aligned object, whereas the Service Application Proxy is the indented object with the same name. 8. Click Manage on the ribbon. The following screenshot will appear for configuration:
9. Click on the Global Settings option. 10. The Visio Graphics Service setting form will appear and at the bottom there is a spot to fill in Application ID for the unattended service account. Use the account that was set up in step 6. 11. Click OK.
How it works... Visio Services is managed by the Visio Graphics Service application. The first important milestone in our recipe happens after Step 4. When we fill in this form and click on the Create button, the Visio Services Application and associated service proxy are created and started. In SQL, a database is created and now the WFE and the application server can communicate using web services (WCF). Refer to the Managing a Service recipe for the explanation on the web service. In step 10, we needed an unattended service account for Visio Finance. This account gives us the ability to access our back-end data that is utilized in the Visio web parts.
62
Chapter 2
Name: The name of the Managed Metadata Service.
Database Server: The SQL Server where the MMS database is located.
Database authentication: In most cases, use Windows authentication. 65
Chapter 2
Getting ready Because we are showing this with PowerShell, you must be a member of the SharePoint_ Shell_Access database role on the configuration database of both the publishing farm and consuming farm. You also must be a member of the WSS_ADMIN_WPG local group on the chosen servers.
Finally, the two servers you will be using (one on the Publishing Farm and one on the Consuming Farm) must be selected ahead of time and the same two servers must be used throughout the process. The suggested servers to use are the ones hosting Central Administration.
How to do it... Export the certificates: Publishing Farm 1. On the chosen publishing farm server, select Start | All Programs | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell. 2. In the PowerShell command prompt, type in the following two commands: $rootCert = (Get-SPCertificateAuthority).RootCertificate $rootCert.Export("Cert")|Set-Content C:\pubfarm.cer –Encoding byte
Export the certificates: Consuming Farm 3. On the consuming farm server, select Start | All Programs | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell. 4. In the PowerShell command prompt, type in the following four commands: $rootCert = (Get-SPCertificateAuthority).RootCertificate $rootCert.Export("Cert")|Set-Content C:\consumingfarm.cer – Encoding byte $stsCert=(Get-SPSecurityTokenServiceConfig) LocalLoginProvider. SigningCertificate $stsCert.Export("Cert")|Set-Content c:\consumingfarmsts.cer – Encoding byte
67
Service Applications
Import the certificates: Publishing Farm 5. Copy the consumingfar.cer and the consumingfarmsts.cer file from the consuming farm and put them in the C:\temp folder on the chosen server in the publishing farm. 6. In the PowerShell command prompt, type in the following four commands: $trustCert=GetPfxCertificate c:\temp\consumingfarm.cer New-SPTrustedRootAuthority ConsumingFarm –Certificate $trustCert $stsCert=GetPFXCertificate c:\temp\consumingfarmsts.cer New-SPTrustedServiceTokenIssuer ConsumingFarm -Certificate $stsCert
Import the certificates: Consuming Farm 7. Copy the pubfarm.cer file from the publishing farm and put it in the C:\temp folder on the consuming farm. 8. In the PowerShell command prompt, type in the following two commands: $trustCert=GetPfxCertificate c:\temp\pubfarm.cer New-SPTrustedRootAuthority PublishingFarm –Certificate $trustCert
How it works... Step 2 under How to do it… section comprises of two parts—setting the $rooCert variable to RootCertificate and then exporting that certificate to a physical file, pubfarm.cer. Step 4 does the same thing except the fact that this is an extra step to provide the publishing farm with a Security Token Service (STS) certificate. In steps 6 and 8, there are two italicized parameters—ConsumingFarm and PublishingFarm. These are unique names created by us as administrators. The names represent the purpose of the farm. It is recommended to give them more meaningful names so that their purpose is clear. Both the publishing and consuming farms must exchange certificates. In addition, the consuming farm must export a security token service certificate, which the publishing farm imports. Most of the service applications utilize web services to access the SharePoint databases. Web services do this on behalf of an authenticated client. In SharePoint 2010, it is the STS that authenticate clients. The clients in this chapter are service applications who provide credentials to the STS. Once authenticated, the STS issues a security token to the service application, which is their "passport" to obtain the information they are requesting.
68
Chapter 2
There's more... While exporting must be done with PowerShell, there is a user interface in Central Administration for importing certificates. 1. Navigate to Central Administration and click Security. 2. Under the General Security section, click Manage trust. The ribbon will light up after clicking on the name of the farm. Now you can click New to establish a trust relationship, or you can click Edit to modify the Token issuer description or the certificates that are used. Finally, there is a Delete option to allow you to remove a trust relationship.
Publishing a SharePoint service One of the key advantages of service applications is their ability to be consumed on an a la carte level. Use the service only as you need it. Extending this paradigm further, service applications are similar to services in a cloud. Use what you need, no matter what farm you are using. This gives organizations the ability to pool their resources effectively. An example of a resource that could be shared is content types. Many organizations are ISO certified and as such they are required to collect particular information with regards to their documents. A content type can be set up to which custom fields are assigned. For example, we could create a field called Safety Training Date and assign that to the content type. As the SharePoint installation grows, more web applications and site collections are created. The organization does not want to recreate the content type that contains the field safety training date in each farm. By publishing the metadata service, other farms can consume this service and no redundancy is created. Further, maintenance of the content type is from a central location providing consistency and timeliness. The organization can adapt easily to change. In order to use another service application, it must be made available. This is referred to as publishing the service.
Getting ready You must have local administrative permissions to the SharePoint 2010 web front-end (WFE) and have Farm Administrator privileges to Central Administration.
69
Service Applications
How to do it... 1. Open the Central Administration screen and click Application Management. 2. The third section is Service Applications. Under it click Manage Service Applications. 3. Navigate to the service you will be publishing. Click to the right of the service name and check to see that the ribbon has lit up. The chosen service should look like the following screenshot:
4. Click Publish on the ribbon. The following form appears:
70
Chapter 2
5. Copy the published URL that was saved in step 4 of Publishing a SharePoint Service recipe. After clicking OK, the following screenshot will appear:
6. Click on the Managed Metadata Service link. Now the OK option will be enabled. After clicking OK, the following screenshot will appear:
7. You may rename the connection. Leave this value to default and click OK. The service is now connected.
How it works... The Application Discovery and Load Balancer Service Application are the means by which farms know which service application are available to be consumed. This service is also referred to as the Topology Service.
73
Service Applications When we published the service application, a URL was automatically created that we used as the input to step 4. This URL is what the Topology Service discovers. In step 5, the topology service shows the services that we could use as connections. In the example explained here, there is only one to choose. Once everything is completed from the consume recipe, the new service application being consumed will appear with the name given in step 7 (referred to as Connect to: Managed Metadata Service) under the Managed Metadata Service.
There's more... The setup of consuming another service can be done with scripts through the use of PowerShell. Here are the two associated PowerShell commands that must be run in the order shown: PowerShell: Consuming Cmdlets Receive-SPSharedServiceApplicationInfo -FarmUrl
This step obtains the URL that will be used in the following step. SP-ServiceApplicationProxy -Name"<ServiceApplicationProxyName>" -Url ""
See also ff
Publishing a SharePoint service
ff
Establishing a trust relationship between farms
74
3
Farm Governance In this chapter, we will cover: ff
Administering SharePoint Designer
ff
Configuring a Managed account
ff
Creating a new policy for web application
ff
Configuring Resource Throttling (large lists)
ff
Installing a feature and activating it
ff
Restricting web parts access in the farm
ff
Learning timer job management (including server affinity)
ff
Running a timer job on demand
ff
Configuring Sandbox functionality
Introduction Governance is a large topic on its own. There are books dedicated solely to this topic. What is being covered in relation to governance are ten items that, when used, makes your life as administrator a bit easier. An administrator's job is akin to being the Marines. They are the first ones to be called when there is an issue with SharePoint. Nothing gets done without their knowledge. Typically, the administrator has to decide who to bring in when an issue needs to be addressed. Additionally, administrators deal with management, end users, developers, and the power users.
Farm Governance The recipes in this chapter teach and expose useful and common functionality found in SharePoint 2010. The intent of the recipes is to create a SharePoint Farm environment that is efficient and monitored. For example, large lists have always been an issue in SharePoint in the past, with little or no support to address it out of the box. This is directly related to the performance of your SharePoint installation. This chapter has a recipe on a new functionality, throttling large lists. As we have seen in other chapters, PowerShell is a critical tool for the SharePoint Administrator. While the recipes may only show how to use the commands at a granular level, they may be combined to create powerful administrator scripts. As a result, many of the tasks that are performed today can be automated and collected at a macro level. After reading this chapter, think about how these techniques can be combined.
Administering SharePoint Designer SharePoint Designer 2010 is a powerful tool that helps create rapid solutions using SharePoint. As the tool is free, any user can download and access its functionality. By connecting to a SharePoint site, users can freely make significant changes to the site. This includes the look and feel of the site, workflow, and connecting to external sources. The issue with this amount of power is the havoc that can be done by creating customizations that inadvertently tax the SharePoint Server(s). The end result may be a degradation of the responsiveness of the SharePoint farm, adversely affecting the performance of the site. Let's look at the preceding paragraph in terms of a real workflow as an example. Workflows are very popular and can be done out of the box with SharePoint Designer. Zach's trucking company hauls product all over the country. They get their work responding to a Request for Quotation. They can get up to ten RFQs per day. The requirement is that when an RFQ document gets uploaded, several tasks are created in a separate list for multiple people. Using the task list, they can determine when the document is ready to be sent out. The workflow can be created in SharePoint Designer (SPD) out of the box. If the person using SharePoint Designer is not well-versed in creating workflows, it is possible that he/she might create long running tasks and infinite loops. Over time, the farm performance will degrade. This is because at the heart of SharePoint, every call made goes back to the SQL database. An infinite loop could cause a list to become quite large.
76
Farm Governance 5. The following screenshot appears:
Fill in the required information:
78
Allow SharePoint Designer to be used in this Web Application: Unchecking this box will disable SPD for the entire web application. Allow Site Collection Administrators to Detach Pages from the Site Template: Once this option is unchecked, Site Administrators will not be able to detach pages and modify them via SPD. Allow Site Collection Administrators to Customize Master Pages and Layout Pages: If it is unchecked, Site Administrators will not be able to customize pages via SPD. Allow Site Collection Administrators to see the URL Structure of their Web Site: If unchecked, it will not allow Site Collection Administrators to manage the URL structure via SPD.
Chapter 3
Fill in the required information:
User name: Supply the AD account. It does not have to be prefaced with domain. Password: This must match the account password in AD. Enable automatic password change: Checking this will allow you to set the time and notifications by e-mail.
When finished filling the required data, click OK. The account is now added.
How it works... When the account is added as shown in the recipe, its credentials are now managed and stored within SharePoint. SharePoint 2010 can leverage the AD policies to automatically reset passwords. Once the account is in SharePoint, it is encrypted using the farm encryption key that was specified when the farm was created based on the passphrase. A key benefit of using managed accounts is the ability conferred upon the Farm Administrator to join machines to the farm without specifying the credentials. 81
Farm Governance
There's more... PowerShell can be used to do anything you can do through the Central Administration user interface. Powershell: Get a listing of managed accounts Get-SPManagedAccount
Powershell: Create a new account New-SPManagedAccount
Powershell: Set Set-SPManagedAccount -identity
Powershell: Delete a managed account Remove-SPManagedAccount
More info You cannot use the Central Administration UI to assign local accounts to be managed accounts. This is achievable, but only through PowerShell.
Creating a new policy for a web application There are times when it is critical for the Farm Administrator to designate security policies for a web application. An administrator can do this from Central Administration and it overrides security implemented at the site collection and at sub-site level. The following are some useful scenarios where this may be implemented: ff
Enterprise organizations need to designate at least one person as the Site Administrator. Once assigned, they are now the administrator of the web application. This is not to be confused with the Farm Administrator or a Site Collection Administration.
ff
When bringing sites online, it is advantageous to set up security to deny access to all users. Allow access to only those users who are your beta users. After the site is live, you can remove these restrictions.
In this recipe, we will show how to create a new policy and then add users to it.
82
Farm Governance The list is comprised of five components:
Name: Create a name for the permission level with a description. Site Collection Permissions: Selecting the Administrator option automatically grants read and write access to everything. Selecting Auditor for the site collection gives read access to everything. List Permissions: Granular control to deny or grant rights over objects at a list level. Site Permissions: Granular control to deny or grant rights over objects at a site level. Personal Permissions: Gives the users in this policy control over personal views and web parts.
For the purposes of this recipe, do not select site collection administration or auditor. Check Grant All. Click Save. BetaFinanceTesters now appears in the listing of permissions policy. Click OK. 7. On the web application page, click User Policy on the ribbon. 8. A screen is displayed, showing users who have a policy for the web application. Click the Add Users link. 9. A wizard pop-up is presented. Choose the All zones option from the drop–down list. Click Next. 10. On the ensuing form:
Select a user (or group).
Under Choose Permissions, check BetaFinanceTesters.
Choose System Settings. Do not check the box Account operates as System box.
11. Click Finish.
How it works... This recipe is broken into two parts: ff
Setting the permissions policy: In steps 4 to 8, we defined a custom policy that was consequently saved in SharePoint. This policy defines the rights of the users that will belong to it. It is associated with the web application chosen. In our recipe, we showed how to add a policy. By clicking on an existing policy, it can be edited. There is also an option to delete the policy.
84
Farm Governance 5. Click the General Settings dropdown on the ribbon:
6. Click the Resource Throttling option from the drop-down list. The resulting form has the following components to be configured:
List View Threshold: Defaults to 5000.
Object Model Override – Yes/No radio buttons. The default value is Yes.
List View Threshold for Auditors and Administrators: Defaults to 20000.
List View Lookup threshold: Defaults to 6.
Daily Time Window for Large Queries: Check this option which, when enabled, allows setting of a start time and a maximum duration. List Unique Permissions Threshold: Defaults to 50000. Backward-Compatible Event Handlers: On/Off radio buttons. Defaults to Off. HTTP Request Monitoring and Throttling: On/Off radio buttons. Defaults to On. Change Log: Defaults to 60 days after which log entries are deleted. Can be set to Never.
After making changes to any component(s), click OK.
How it works... Resource throttling is performed at the web application level. The configuration applies to all site collections and sites under the web application. Throttling can be completely disabled in Central Administration for a web application, as seen in the parameter HTTP Request Monitoring and Throttling. By default, resource throttling checking is on, which enables a timer job that runs every five seconds. This job checks the state of server resources against the performance counters. If that check comes back with a failure three times in a row, a throttling state will be enabled. The server will stay in this state until a successful check is performed. 86
Chapter 3
While in a throttled state, users may see a 503 Server is busy screen. Users will need to refresh their screen to see if their request has completed. The resources that are checked by default are Server CPU, Memory, Request in Queue, and Request Wait Time. The List View Threshold is the number of items that can be returned to a user. By default, this is 5000 items. The List View threshold for Auditors and Administrators is the number of items that can be returned to an administrator or power user. The default is 20000 items. List View Loopup Threshold is the maximum amount of fields with the type called Lookup in a list. Lookups are database intensive. The default is 8. List Unique Permissions Threshold is when inheritance is broken on a list and granular permissions are involved. Item-level permissions have potentially severe consequences on database performance and must be considered and planned carefully.
There's more... PowerShell can be used to view, set, and enable/disable resource throttling. PowerShell: View list of Performance Counters Get-SPWebApplicationHttpThrottlingMonitor–identity
PowerShell: Set Performance Counters Set-SPWebApplicationHttpThrottlingMonitor–identity -Category -Counter -Instance -MaxThreshold <maxthreshold> -MinThreshold <minthreshold>
PowerShell: Disable Resource Throttling Disable- SPWebApplicationHttpThrottlingMonitor–identity
PowerShell: Enable Resource Throttling Enable- SPWebApplicationHttpThrottlingMonitor–identity
More info Server CPU, Memory, Request in Queue, and Request Wait Time are monitored by default. A new performance counter has to be added via the object model. The counters that are used can be obtained via the Performance Monitor application on the server. Here is an example of how to configure the Processor Time: $uri = new-object System.Uri(http://"yourwebsite")
87
Chapter 3
4. Install the feature by typing the following into the console window: Install-SPFeature -path "helloworld"
Press the Enter key. 5. Activate the feature by typing in the following command: Enable-SPFeature -identity "helloworld" -URL http://sharepoint2010
Press the Enter key.
How it works... The feature is installed on a web front-end server in the \14\template\ features\ folder. If the file is not there when doing the install, an error message will be displayed. Features are best wrapped in a solution file. Solution files can be installed across a farm, which is efficient when dealing with a multi-server topology. It also can be installed to the Sandbox. In the recipe that was just presented, the feature was already deployed. The following is how to install and deploy a solution file called helloworld.wsp: 1. Install the solution by typing the following command in the console window: Add-SPSolution c:\temp\helloworld.wsp
Press Enter. 2. Deploy the solution by typing in: Install-SPSolution -Identity helloworld.wsp -WebApplication http://sharepoint2010 -GACDeployment
Press the Enter key. Features that can be scoped at the following levels are seen in the next screenshot:
A solution file, .wsp, is a cab file that contains the following components:
Manifest.xml: This file defines the features (there can be more than one), site definitions, resource files, web part files, and assemblies. Feature.xml: This file defines the location of the assemblies and defines the scope of the feature(s), and any dependencies. 89
Chapter 3
Web Part Connections: The strength of web part connections is that information from one web part can be passed to another web part. Online Web Part Gallery: This is a web part gallery that is either available from Microsoft or one that has been created. Scriptable Web Parts: This will either allow or prevent contributors from adding scripts in a web part. An example of this is JavaScript in a Content Editor web part. Retain the default value.
Click OK.
How it works... This recipe shows web part security at a web application level. Everything shown applies to all site collections under the web application. It works as a blanket policy. It is not web part security at a granular level.
91
Chapter 3
The associated web application
The status of each job
The time when each job was finished or their scheduled start time
On the left-hand side of the screen are the categories for filtering the display of timer jobs, as shown in the following screenshot:
4. Let's now see how to edit a timer job. Click on the timer job called Scheduled Approval. The following form is displayed that enables the administrator to change the schedule, run the job now, or disable the job.
93
4
Site Administration In this chapter, we will cover: ff
Migrating a site collection
ff
Provisioning a site via Windows PowerShell
ff
Managing the Term Store
ff
Adding a column with property of managed metadata
ff
Setting up a site collection policy
ff
Configuring a document set
ff
Configuring multiple Send To connections
ff
Setting up an enterprise wiki
Introduction Microsoft is making a conscious effort to push the task of site administration out of the realm of IT administrator. Organizations can be decentralized and become agile if the ability to do more comes closer to the front lines. Yet, organizations still need to retain central control and ensure the integrity of their SharePoint Farm solutions. The Sandbox functionality in SharePoint 2010 is an example of a win-win solution. IT retains central control of the farm, the hardware, and provides limits. IT administrators can designate a power user who has the ability to roll out code for their SharePoint instance, without adversely affecting the entire farm.
Site Administration Many modifications can be done at the site collection level by power users. These modifications have ramifications across the entire organization. Here is a simple clarification of the terms site and site collection: ff
Site Collection: This is a hierarchical collection of sites that has a single top-level site.
ff
Subsite: A subsite is a single SharePoint site within a site collection. It inherits its properties, such as navigation and security, from the top-level site.
Site collections are beneficial as they promote standardization and automation. By automation, we mean that the modifications do not have to be applied to every child site; they are inherited. Some site collection-level modifications require configuration in Central Administration. In this chapter, we will see some of the common tasks that are done from a site collection administration level. All of the recipes are related to promoting collaboration and common standards at a site collection level. This means when implemented, the recipes can be repeated and extended throughout the SharePoint Farm.
Migrating a site collection Moving a site collection to another content database is a task that is incumbent upon a SharePoint Farm Administrator. There are several reasons why this may need to be done: ff
We may need to combine several site collections under one content database
ff
The site collection is getting too large and must be moved to new content database
This is going to be shown via PowerShell. The strength of this method is that it facilitates the scripting of tasks that are considered repetitive. In this way, administrators can create scripts to move more than one site collection at a time.
Getting ready User must have access to one of the servers running PowerShell 2.0 and should be a member of the WSS_ADMIN_WPG on the local computer. User must also be a member of the db_owner database role and the SharePoint_Shell_Access role in the following databases: ff
Source content database
ff
Administration content database
ff
Destination content database
ff
Configuration database
100
Chapter 4
There must be an existing site collection that is going to be moved. In addition, a destination content database must be set up within a web application, prior to performing this recipe. For this recipe to work, the content database and the site collection must be on the same SQL server and in the same web application.
How to do it... 1. Click on the Start button on the web front-end. 2. Under All Programs, navigate to the Microsoft SharePoint 2010 Products folder. 3. Right-click SharePoint 2010 Management Shell and select the Run as Administrator option. The PowerShell console will appear. 4. Type in the following command into the console window: Move-SPSite –identity <site collection URL> -destinationdatabase
Press the Enter key. 5. A prompt will appear asking for confirmation. It will look similar to the following:
Type in Y and press the Enter key. 6. Perform an iisreset operation in the command prompt window.
How it works... PowerShell is a command line scripting language that has access to the SharePoint object model. In this example under the web application, occupying Port 80, there are two content databases: ff
Wss_content
ff
Wss_content_1
101
Chapter 4
On this screen, we can assign an administrator user, who is a domain-level account, to manage the Term Store. We can also choose the default language. Choose New Group under Managed Metadata Finance as seen in the preceding screenshot. 6. Name the new group as Finance. 7. Create a new term set by clicking the drop-down list adjacent to the Finance option. Refer to the next screenshot:
105
Site Administration 8. Enter the term name as Business Financial Terms. We will get the following properties form on the right-hand side:
Enter values for the Description and Contact field, retaining default values for the rest of the fields. 9. Click Save. 10. From the drop-down list that appears to the right of the Business Financial Terms option, select Create Term.
11. Enter EBITDA. On the right-hand side will appear the following properties form:
106
Chapter 4
In the form, fill in the values for the Description and Other Labels field, keeping the other fields to their default values. 12. Click Save.
How it works... The Term Store taxonomy is managed in a hierarchical fashion, hence the term taxonomy. At the top of the hierarchy is an object called Group. A Group is a security construct for the management of term sets. Each group can have a manager(s) who is/are responsible as the stakeholder(s) of the group. Each Group can also have contributors who are able to edit and add to the term sets and Terms. The next item in the hierarchy is Term Set. This is a container for Terms and can be imported or created manually as we did in the recipe. Each term set can have an owner. The term sets are organized into groups, which can be based on the business stakeholders. There are a maximum of 1,000 Term Sets per group. Finally, the last item in the hierarchy are the Terms themselves. Each term may have a synonym, which is an alternate name for the primary term. There is a maximum of 30,000 Terms added to a Term Set. These are added where the Other Labels is designated. In the recipe we have just seen, a user can type in EBITA, and when the record is saved, EBITDA will be shown in the field. These items, which include managed as well as unmanaged items (keywords, orphaned terms), are saved in the managed metadata database. 107
Site Administration 10. In the section number five, we pick the value from the term set. Enter ebi into the text box under the Use a managed term set option and click the binoculars icon. You should see the following screenshot:
11. Click Business Financial Terms and then click OK at the bottom of the form.
How it works... Business Financial Terms is the Term Set being employed with this column we called Financial Term. We have assigned this column to the list called Tasks. Any time a task is entered, a financial term can be associated with this task. In the example that we have shown, we are consuming the Managed Metadata Finance Service Application. The screenshot shows ebi, but with the type-ahead functionality, EBITDA will be populated. We can add other financial terms such as assets, cashflow, cost of sales, and so on. As long as they are in the term set, every task can be related to one of these terms. Across an enterprise organization, a controller can find all of the tasks that are directly related to finance.
There's more... When a task is being entered, and one of the fields is of the type Managed Metadata, there is a "type-ahead suggestions" service available as we saw in the last recipe. Included in the suggestions are synonyms that have been defined in the Term Store. This feature helps companies standardize the language of their business. Consider a small example. Regions is a popular metadata term. Large international companies have regions set up to fit their businesses. For one company, the North America region may consist of the United States, Canada, and Mexico, whereas for some other, the North America region might constitute United States and Canada. 110
Site Administration
How to do it... 1. Navigate to a site with the team site template implemented. 2. Click on the drop-down icon next to Site Actions and then click Site Settings. 3. Under the category Site Collection Administration, click Site collection policies. 4. Click Create. A form appears that needs to be filled out. 5. Give name to the policy and write some description about it.
Name: Cookbook SC Policy Description: The cookbook site collection policy enables auditing on an object to determine who is downloading, moving, or copying documents
6. Enter a Policy Statement. 7. There are four check boxes: Enable Retention, Enable Auditing, Enable Barcodes, and Enable Labels. Check the box for Auditing. Then check the remaining boxes as seen in the following screenshot:
Click OK. 8. Click on dropdown next to Site Actions, and then click Site Settings. 9. Under the Galleries section, click Site content types. 10. Choose the custom content type that has been created prior to performing this recipe. 11. Click Information management policy settings. 12. The Specify the Policy form appears. Choose the radio button as seen in the following screen:
112
Site Administration When buying a house, there are many forms to be filled out. They are methodically handled by several different parties—the bank, the seller, the real estate company, and so on. It all starts with a mortgage application. The application is submitted and a workflow kicks off for each item such as getting a credit report, appraisal on the property, employment verification, among other things. Once the individual workflows come back with information, the application is then submitted to another party, which must approve the loan. Each workflow item is kicked off independently, but together they contribute to the final answer, which is whether or not the mortgage is approved for the potential buyer. Once the mortgage is approved, there is a deed issued and sent to a title company and a payment plan is set up. This process is comprised of many forms and parties, and your ability to get the final approval is contingent upon each step being completed properly. This recipe will show how to set up a document set for the mortgage process.
Getting ready We first need to enable the Document Set Site Collection Feature. Set up the following content types and group them under the type Mortgage: ff
AssetListCT—parent content type of Item
ff
CreditApplicationCT—parent content type of Document
ff
SalesContractCT—parent content type of Document
How to do it... 1. Navigate to a site with the team site template implemented. 2. Click on the dropdown next to Site Actions, and then click Site Settings. 3. Under the category named Galleries, click Site content types. 4. Click Create. The following form appears:
114
Chapter 4
5. Fill in the form as shown in previous screenshot and then click OK. 6. Click Document Set Settings. 7. Under the Allowed Content Types section, choose Mortgage from the drop-down list. Select CreditApplicationCT and SalesContractCT from under the Content Type dropdown. 8. In Default Content, choose each content type selected in step 7 and add an associated document for each. Check the Add the name of the Document Set to each file name box. Your screen should look like the following screenshot:
9. Under Shared Columns, check the boxes for Description and Managed Keywords. 10. Add Managed Keywords to the Welcome Page Columns. 11. Do not customize the Welcome page. 12. Leave the Update all content types inheriting from this type option to Yes. Click OK. 13. Create a document library called Mortgage. 115
Site Administration 14. The ribbon lights up. At the far end, click Library Settings. 15. Click Advanced Settings. 16. Set the Allow management of content types option to Yes. Click OK. 17. In the Content Types section, click Add from existing site content types. 18. Add the MortgageDS content type, and click OK. 19. Navigate back to the Mortgage document library. Click Documents under Library Tools. 20. Click the drop-down list next to New Document and select MortgageDS.
21. An entry form appears. Fill in the Name, Description, and Managed Keywords fields. Click Save. 22. The following landing page appears with the necessary documents:
116
Chapter 4
How it works... Steps 1 to 5 show the process of creating a document set and giving it a name. Document Set is a content type. In our example, MortageDS inherits from this content type. In steps 6 to 13, content types are assigned to be part of the document set. Also, documents are associated with their content types in step 8. In step 9, columns are included in the welcome page. These columns can be shared across the document in the document set itself. For instance, we could have added Mortgage Company as a column and had it applied to each document in the set. This recipe did not set up any custom columns. Also, this recipe did not customize the welcome page. The last part of the recipe is creating the document library, enabling management of content types, and then assigning the Mortgage document set to the library. When a new document set is created, all the associated documents with their content types are shown. A loan processor could now go through and process all the necessary paper work without missing a mandatory form.
There's more... Workflows can be created with SharePoint Designer and applied to the entire document set. Keeping in mind our Mortgage loan example, a workflow could be set up to send information to the title company and get information from the credit bureau. The application could then be sent to the bank after the credit bureau sends their information. In addition, permission levels can be set on the individual documents. Finally, retention policies can be added to the document set.
More info Document sets are built upon the content type SPFolder.
See also ff
Setting up Retention Management
117
Site Administration
Configuring multiple Send To connections Records management is the careful management of information for an entire lifecycle. This includes how documents are routed and referenced. A records management feature that deserves its own recipe is the ability to set up multiple Send To connections. What is meant by this capability is the functionality to route a document to multiple areas in a site. The reasoning for this is varied. There may be a Request for Quote (RFQ) that comes in and needs to go to several folks upon being uploaded into the system, as each individual may have a role in a particular part of the document. Another use case is when an asset must have one source location but must be in several other locations. Thus, links are established to one source. Farm administrators have the ability to define multiple locations where a record can be routed. Not only can an administrator specify the connections, but they can define how that record is manipulated. Is it copied? Is it moved? Moved with a link to the source? In this recipe, multiple connections will be set up in Central Administration. We will also see how this affects the consumer of the site.
Getting ready You must have farm-level administrative permissions to the Central Administration site. This recipe builds upon the previous recipe on document set creation. You will need to create two Records Center sites if you have not performed the previous recipe: ff
Mortgage Active: http://2008server/sites/ts/MortgagesActive
ff
Mortgages Archived: http://2008server/sites/ts/MortgageRepository
How to do it... 1. Open the SharePoint 2010 Central Administration website. 2. Click General Application Settings. 3. Under the External Service Connections section, click Configure send to connections. 4. The following form appears:
118
Chapter 4
Ensure this is being done under the proper web application. Keep the check on the box for allowing sites to send to connections outside of the site subscription. Fill in the following details:
Display Name: Active Mortgages
Send To URL: http://2008server/sites/ts/MortgagesActive
Check the Allow manual submission from the Send To Menu option
Send To action: Select the Move and keep link option from the drop-down list Enter an Explanation.
Click Add Connection. 119
Site Administration 5. Perform the same steps as step 4, changing the following:
Display Name: Archive Mortgages
Send To URL: http://2008server/sites/ts/MortgageRepository
Click Add Connection. There should be two connections showing in the Send To Connections box.
How it works... The Send To connection is configured per web application and is available to all records in that container. From the screenshot of step 4, we can see there is a Send To URL option. When the URL is entered and tested, it is verified as successful via the officialfile.asmx web service. If it cannot route to the URL provided, it will return an error message. There are three different actions that can be implemented when routing a record, of which the recipe utilized Move and Keep Link. There is also Move and Copy.
There's more... Once the Send To is configured, the users with the proper rights can go to a record and choose Send To other location. In the previous recipe, we created a mortgage dataset and populated it with one record called Peter Serzo.
From the preceding screenshot, click Send To other location and the following form appears, showing us the available locations to choose from:
Once the Send command is initiated, the prescribed action is taken.
120
Site Administration 7. In the Select a Template section, choose the Publishing tab and then click Enterprise Wiki. Refer to the following screenshot:
8. Enter the value for the Primary Site Collection Administrator. 9. Click OK.
How it works... The enterprise wiki is a publishing site. For its infrastructure, we can use all of the components that are contained within. Web parts such as the powerful Content Query or media web part are available. Lists, pictures, or even data from external sources can be leveraged and surfaced. The ribbon exposes the previously mentioned items and also the rich text editor. The publishing infrastructure contains templates so that an editor can change the layout by selecting an item from the Page Layout tab. The SharePoint 2010 Enterprise Wiki Page is a content type that includes the following columns:
The wiki that comes with SharePoint Foundation is derived from the document content type. It does not include items such as Target Audiences and Rating. It is an extremely light version.
122
Chapter 5
Fill in the following details:
Usage Data Collection: This is enabled by default. Event Selection: These are specific events that are being logged. Use the check box to enable or disable them. Usage data collection settings: In this section, the location of the ULS logs are set. Also, there is a setting to limit the size of the log file. Health data collection: This is enabled by default. Log Collection Schedule: Administrator has the ability to change the schedule.
5. Modify the settings in step 4 and click OK.
129
Monitoring and Reporting 5. A form pops up, which contains the parameter of the rule. The left-most ribbon button is Edit Item; click the button. The following screenshot appears:
6. Change the Schedule to Daily, from the default value of Weekly. 7. You must also manually change the value of the parameter Version. Change it to 2.0, from present 1.0. 8. Click Save.
How it works... The health analyzer rule definitions are run via the timer jobs. There are several parameters that the administrator can modify: ff
Title: This is the text description of the rule.
ff
Scope: This is where the rule will run.
ff
Schedule: This is how often the rules are employed.
ff
Enabled: This designates the rule as active.
132
Monitoring and Reporting
There's more... The data shown with date ranges can be modified. This can be achieved by clicking on the Change Settings link above the graph:
The following ribbon appears:
With a click of the appropriate date button, the data will be filtered. Depending on the report, there may be filters other than date. Finally, the report can also be customized or exported to Excel. This can be done with the help of the two buttons on the right-most side of the preceding screenshot.
More info Customized reports are also possible. There is an Administrative Report Library in Central Administration. There are folders in that library that contain reports written by someone in the organization. These reports may be particular to an organization's needs or audit concerns, among other things. There is a Customized Reports link on the left-hand navigation shown in a preceding screenshot; currently, there is only Search Administration Reports in there.
See also ff
136
Chapter 2, Service Applications, shows how to set up several different service applications. While Web Analytics are not covered, the basics are the same.
Monitoring and Reporting 5. On the publishing farm server, select Start | All Programs | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell. 6. In the PowerShell command prompt, type in the following command, replacing the correlation ID with the one from your screen. Get-SPLogEvent | ?{$_.Correlation -eq "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
It should produce a message from the log file that reads: There are no instances of the Web Analytics Service Application started on any server in this farm. Ensure that at least one instance is started on an application server in the farm using the Services on Server page in Central Administration.
How it works... The PowerShell command, Get-SPLogEvent, does the job of retrieving all events in the log files. The | character sends the output of Get-SPLogEvent to the next command. The ? is the "where" command. The curly braces is the "where" condition. The $_ notation is used to represent the object being sent across the pipeline. Finally, the -eq option represents the "equal to" condition. As a whole, this statement does a search job in the log files for a particular correlation ID, and produces the information associated with the request. A request is traced through its lifetime. The correlation ID collects information across multiple servers maintaining the integrity of the request. As we have seen in Chapter 2, different sites can consume information from an application server that resides in a different farm but is shared. Without the correlation ID, it would be very difficult and cumbersome to trace an error. When an error occurs, the correlation ID will have the same reference across all of the servers. This applies to WFE, application, web services, and any other components that are consumed.
There's more... There are two other methods for looking up a correlation ID other than PowerShell. They are: ff
Using Excel (or notepad): Log on to the Web Front End server that generated the error and navigate to the location of the ULS logs. Open the log file in Excel and utilize the find and innate filtering capabilities of Excel to find the correlation ID.
ff
Utilizing the logging database: You can execute the Accessing the SharePoint 2010 logging database recipe and then look for the correlation ID.
138
Chapter 5
When the OnDemand mode is specified, a button appears in the upper right-hand corner of the page as shown here:
When clicked, the Developer Dashboard is shown, and when clicked again, it disappears. This gives adminstrators the flexibility of enabling the Developer Dashboard without the need to make it visible always.
More info The Developer Dashboard is available only with Windows authentication and is not available with SQL authentication.
141
Chapter 6
How to do it... 1. Open the Central Administration site and click Application Management. 2. The third section is Service Applications. Under this section, click Manages service applications. 3. On the ribbon, click New and Search Service Application. 4. The following screenshot appears. Fill in the details.
Name: This is the name for the Search Service application. FAST Service Application: Choose None as this book does not cover Fast Search. If you wish to read more about Fast Search, refer to the following link: http://sharepoint.microsoft.com/en-us/product/ capabilities/search/Pages/Fast-Search.aspx. Search Service Account: Use the account that was created as a requirement of this recipe. Application Pool for Search Admin Web Service: Create a new application pool and assign the same security account that was used in the Search Service. Application Pool for Search Query and Site Setting Web Service: Utilize the same application pool used for the Search Admin Web Service.
5. Click OK.
145
Search 5. Click on the domain/username adjacent to the Default Content Access Account option. 6. A pop-up form titled Default Content Access Account appears. Put in the account that was set up for the previous recipe. Then type in the password. Click OK. 7. Click on the e-mail address adjacent to the Contact e-mail address option. Change this to the appropriate e-mail for your organization. Click OK. The changes for both items should be reflected in the Search Administration screen.
How it works... SharePoint 2010 has an extensive Search Administration screen as shown. It is broken down into four sections. ff
The first section is the Administration navigation. This is the left-hand panel, where the quick launch is typically located in SharePoint. It contains four subgroups comprising of Administration, Crawling, Queries and Results, and Reports. Other recipes will address these areas.
ff
The second section is the System Status. This is where the performance of the crawls and queries are documented. We changed the e-mail and content account. It is important to always keep in mind the least privileged accounts. In step 6, we used the same account as the Search Service. Based on the security rules of your organization, it is a best practice to set up a different account and use it here. The default content access account is the crawl account. Having too much access may result in the account crawling information that should not show up in the index.
ff
The third section is the Crawl History results. This is a summary of current and past crawls. It also shows the length of time a crawl takes, the type of crawl (Full, Incremental), and whether the crawl succeeded or failed.
ff
The last section is the Search Application Topology. This is where administrators can scale out a search. It shows the components of a search implemented by the server. Changing the server will show the associated components. The components shown are the following: Administration, Crawl, Databases, and Index Partition.
There's more... The changes made in this recipe were done through the user interface. Using PowerShell is another way to make changes to Search Administration. SPEnterprisesearchserviceapplication is the cmdlet used to make changes to the Search Server application.
148
Search 4. Under the Search Application Topology section, there is a button called Modify; click on that button. 5. The Search Service Topology page appears. Click the drop-down list named New and then choose the Index Partition and Query Component option. 6. The following pop-up screen appears:
Perform the following actions: 7. Choose a server from the drop-down list. 8. Choose the property database with which it will be associated, from the Associated Property Database drop-down list. 9. Indicate the Location of Index. 10. Do not check the box associated with the Failover-only Query Component option. 11. Click OK. 12. The Search Service Topology Application page will again be shown. To commit the changes you have done on the previous pop-up screen, click on the Apply Topology Changes button.
How it works... Creating a new query component is done through the administration page, which shows the farm's search topology. This topology can be viewed either by server or by component, using the View dropdown on the right-hand side of the screen. See the following screenshot:
150
Chapter 6
The query component returns the search results. A query server is where a query component has been created. The query component contains only part of an index partition. If there is only one query server, it would contain the whole partition. An index partition can be spread across two or more query servers. The purpose is to reduce the size of the index on a particular query server, which translates to better performance. Index partitions are roughly equal in size, which lends itself to the low query latency. SharePoint achieves this with the help of internal distribution by DocumentID. Every item is internally given a DocumentID, which is a unique identification marker. It is important to note that an index partition is associated with a property database as we saw in the recipe. Index partitions are not configured by users. Administrators don't know which item is sitting on which query server. Again, there is no single index (unless there is one query server). After clicking Apply Topology Changes, some time may elapse before the update process is performed, as a timer job is used to perform the update.
151
Search 14. The following pop-up screen appears:
Perform the following steps: 15. Choose a server from the drop-down list, on which to host the crawl component. 16. Choose the associated crawl database from the drop-down list. 17. Specify a location for the index by entering the value in the Temporary Location of Index textbox. Click OK. 18. The Search Service Topology Application page will again be shown. To commit the changes you have done on the screen, click the Apply Topology Changes button.
How it works... The creation of the crawl database is similar to the property database. A new database is added to the farm and can be seen physically via SQL Management Studio. The only additional item is using host distribution rules, which will be covered in the Adding a host distribution rule recipe. The crawl component, which is created after the database, creates a temporary index that gets stored on the Crawl Server. This index is eventually propagated and overwritten. The crawl content and the data such as the location of the content source are saved in the crawl database. It is the crawler's job to propagate partition-indexed data to the query servers. The crawler is truly a stateless object.
There's more... Everything done using the UI can be scripted via PowerShell in order to automate the procedure.
156
Search
How to do it... 1. Open Central Administration and click Application Management. 2. The third section is Service Applications. Under this section, click Manage service applications. 3. Find the Search Service Application option and click on it (this is the name SharePoint assigns by default if not modified when creating the Search Service). The ribbon will light up. Click Manage. 4. On the left-hand navigation, under the section marked Crawling, click Host Distribution Rules. 5. At the top of the displayed page, you can see the Add Distribution Rule option; click this option. 6. The following screen appears:
Enter the hostname that contains the content you want to index (for example, accounting.contoso.com). Select the crawl database that you want to make responsible for crawling the specified hostname.
Click OK. 7. Click Apply Changes. 8. A confirmation screen appears. Click Redistribute Now.
How it works... When indicating an existing host, the content is physically moved and assigned to the crawl database that was selected. In the recipe, we set up a dedicated host name distribution rule. When a crawl database is designated to a host stored in the rules, the crawl will not allocate any new host addresses into this crawl database. This means the host (or server) is a one crawl database. By default, servers are load-balanced across crawl databases.
158
Search
How to do it... Part 1: Creating Managed Property 1. Open the Central Administration site and click Application Management. 2. The third section is Service Applications. Under this section, click Manage service applications. 3. Find the Search Service Application option and click on it (this is the name SharePoint assigns by default if not modified when creating the Search Service). The ribbon will light up. Click Manage. 4. On the left-hand navigation, under the section marked Queries and Results, click Metadata Properties. 5. Click New Managed Property. A new form appears. 6. In the Name textbox, type Finance. 7. Under Mappings to crawled properties, click Add Mapping. 8. The following pop-up screen appears:
9. In the Select a category listbox, select SharePoint. 10. Navigate to the Finance property. Click OK. 11. On the New Managed Property page, check the box for Use in Scopes. Click OK. 12. Initiate a full crawl on the Local SharePoint sites (under Content Sources). 162
Chapter 6
Part 2: Creating Custom Refiner 1. Navigate to the Search Center page, for example, servername/SearchCenter/ Pages/results.aspx. 2. Perform a search. Click Site Actions, Edit Page. 3. In the web part marked Refinement Panel, select Edit Web Part from the drop-down list. 4. Under the section Refinement, there is the Filter Category Definition. Click the … box to the right of this.
5. You are presented with a text editor of the contents. Select all of the text (Ctrl+A) and copy and paste the contents into Notepad. 6. Run a search query on Author. Copy the author's category tag. It will contain the following:
7. Paste the copied tag right after the end of the original Author tag.
163
Search 8. Make the following changes: a. Change the Title to Finance. b. Change the MetadataThreshold to 1. c. Change MappedProperty to Finance. 9. Copy and paste the complete text from the Notepad (where we copied the text to in step 5) into the text editor. Click OK. 10. Ensure the Use Default Configuration option is unchecked. 11. Click Apply and then OK on the Web part properties dialog. 12. Check in and publish page. 13. Perform a search by your name. Doing this makes the assumption that there are documents with your name in them, about you, or created by you.
How it works... The refiner panel is a web part on the Search results page that contains properties to completely configure the way it looks and behaves. In this recipe, we utilized the Refinement XML configuration to add a new category. Part 1 of our recipe creates the managed property. A prerequisite of this recipe was to create a column that we could consume. Once this was done and the content was crawled, the property becomes available to define as a managed property. This part is done by a Search Administrator or the Farm Administrator. Part 2 of our recipe took that property and mapped it to a category of our creation. We performed this in step 15. This is done at the site level. The end result is a panel that looks like the following screenshot:
164
Chapter 7
5. Type the following into the console window, replacing the parameter values with ones relevant to your environment: Add-SPShellAdmin –username domain\jdoe –database 047e05eb-2d6846a1-b0e0-e9ac92e99ff8
Press the Enter key again.
How it works... The first command did the following two things: ff
It added the user to the SharePoint_Shell_Access role in the farm configuration database. If the role was not in the database, it is created automatically. When the user is added, the role grants the users, db_owner as well as securityadmin, with the rights to the farm configuration database.
ff
It added the user to the WSS_ADMIN_WPG local security group on each server in the farm.
The second command added the parameter named database. We targeted a specific content database (using its GUID in this case) and the user was added to the SharePoint_ Shell_Access role for that database. Additionally, the user is added to the role in the Central Administration content database.
There's more... Using PowerShell, an administrator can obtain a list of names that are part of the SharePoint_Shell_Access role, with the help of the following command: Get-SPShellAdmin
More info The most effective use of PowerShell is in regards to scripting. Actions can be automated. Automation comes in the guise of writing code. Combine this statement with the type of access that is granted in this recipe—db_owner. This should not be granted without any thought, for example, power users should not be conferred with so much authority. A typical power user cannot write, and should not be authorized to write code, in order to automate things such as uploading a Term Set to the managed metadata service. On top of that, a power user should not be granted the db_owner access as is shown in this recipe. Note that PowerShell does not do security trimming. When a user is given this ability on a database, they have db_owner access to everything in that database.
171
Content Management 8. The following pop-up screen appears:
182
Chapter 8
Fill in the fields as follows:
Name: Enter CashFlow in the textbox.
Status: Leave this as the default value, that is, Active.
Content type Group: Select Document Content Types from the drop-down list.
Content Type: Select Document from the drop-down list.
Property: Select Managed Keywords from the drop-down list.
Operator: is equal to (which is selected by default).
Value: Enter EBITDA in the textbox.
Destination: Click Browse and navigate to Shared Documents.
Click OK. 9. Click Drop Off Library and then Add new document. 10. Click the Browse button. Choose a document to upload and click OK. 11. Fill in the form as follows:
12. Click Submit. A message appears notifying you of the document's final location.
How it works... Routing is configured at the site level and not at the site collection level. Activating the feature not only creates the two menu items as outlined in step 5, but also creates a document library called Drop Off Library. All uploads are sent to this library. This is a document library that has the standard features such as workflow, approvals, check in/check out, alerts, and permissions. Rules are based on content type and can contain multiple conditions. In the example, we based the rule on Managed Metadata (EBITDA). If the uploaded document did not meet the rule's condition, then the document would remain in the Drop Off Library. E-mails would be generated to the rule managers (if the box to send e-mails was checked). 183
Content Management By default, the Drop Off Library option manages content types. The result of this is that when a rule is created for a content type that is not native to the Drop Off Library, it will be added dynamically.
There's more... The second menu item added under Site Settings is Content Organizer Settings. This is where the configuration settings for the Content Organizer are found. The following are the options: ff
Redirect Users to the Drop Off Library: Checking this box redirects users to the Drop Off Library when they try and upload content in the site. This means that no matter what library you try and upload content to, you will be redirected to the Drop Off Library pop-up window shown in step 11. After entering the metadata and submitting the document, it is routed as per the routing rules. If this box is not enabled, only uploading to the Drop Off Library will enable a document to be routed as per the rules.
ff
Sending to Another Site: When checking this box, a document can be routed, as per the rules, to another site that has the Content Organizer feature activated. It provides a drop-down list of the targeted destinations. This is covered in the next recipe.
ff
Folder Partitioning: When checking this box, a subfolder is dynamically created after the maximum number of items (specified in the option) in the store is reached. The new item is routed to the new folder and the name of the folder is controlled by the second parameter. %1, the default setting, is substituted with the date/time stamp. The number of items and folder names is controlled by the owner of the site.
ff
Duplicate Submissions: When a document has the same name as a document already in the destination library, we need to choose one of the two options. If versioning is turned on, a new version of the document is added. The other option appends unique characters to the end of the file.
ff
Preserving Context: The original audit logs and properties for a document are kept with it after it is routed.
ff
Rule Managers: This is a management configuration. Owners are not the only people who can create rules and manage the Drop Off Library. There are two checkbox options, where both the rules are related to receiving e-mails. Enabling the first checkbox will cause the rule managers to receive an e-mail when an item does not match a rule. The second check box has the effect of sending e-mails to the rule managers when items are left in the Drop Off Library.
184
Content Management
How to do it... 1. Open up the SharePoint website from the last recipe. It contains the Drop Off Library. 2. Click Site Actions, then Site Settings. 3. Click Content Organizer Settings under the Site Administration section. 4. In the section labeled Sending to Another Site, check the box shown in the next screenshot:
5. Click OK. 6. Open the second SharePoint website B that was created as part of the requirements. 7. Click Site Actions, then Site Settings. 8. Under the Site Actions section, click Manage site features. 9. The first feature listed is the Content Organizer. Click on the Activate button to the right of the feature. 10. Click Site Actions, then Site Settings. 11. Click Content Organizer Settings under the Site Administration section. 12. In the section labelled Submission Points, copy the web service URL shown. 13. Open the Central Administration screen and click General Application Settings. 14. The first section is External Service Connections. Under it, click Configure send to connections. 15. In the section labeled Connection Settings, set the following parameters in the display as follows:
Copy the URL from step 12 into the Send to URL text box.
Ensure that the Allow manual submission... checkbox is not checked.
Enter Display name as Route Documents.
16. Click Add Connection. 186
Chapter 8
17. Navigate back to SharePoint website A. 18. Click Site Actions, then Site Settings. 19. Click Content Organizer Rules. 20. Hover over the item named CashFlow and click Edit Item. 21. The following screen pops up:
Choose the Another content organizer in a different site option and select Route Documents from the drop-down. Click OK. 22. Follow steps from 9 to 12 from the first recipe. 23. Navigate to the Drop Off Library in SharePoint Site B. The document will be present there.
How it works... The key to this recipe is that both sites need to have the Content Organizer feature activated; steps 1 to 9 accomplish this. Included in those steps was designating SharePoint Site A as having the capability to provide documents to another site. We did this in step 4. The next part of getting routing between sites to work was to configure the connections between the two sites. SharePoint Site A was the provider and SharePoint Site B was the consumer. Central Administration acts as the glue needed to wire up the connection between these two sites. Steps 10 to 16 accomplished the wiring. Copying the URL from Site A, we created a connection through Central Administration. Then we edited the Content Organizer rule from the first recipe and changed the location in the drop-down for the destination. The new location (Route Documents) appeared in the drop-down as result of the changes we did in the Central Administration. As we routed the document, SharePoint provided confirmation, including a link to the new location where the document was routed.
187
Chapter 8
How to do it... 1. Open the Central Administration screen and click General Application Settings. 2. Click Configure Content Deployment. 3. A new page is displayed with six sections:
Accept Content Deployment Jobs: choose Accept incoming…
Import Server: Select Destination Server.
Export Server: Select Source Server.
Connection Security: Retain the default encryption.
Temporary Files: Retain the default setting.
Reporting: Retain the default setting.
Click OK. 4. Click Application Management. 5. Under the second section named Site Collections, click Create site collections. 6. Click WebAppD for Web Application. 7. Fill in the other fields appropriately, except Template Selection. For this option choose the Custom tab and leave < Select template later... > as selected. Click OK. 8. Click General Application Settings. Under the Content Deployment section, click Configure content deployment. 9. Click New Path. 10. Fill in the following on the ensuing page:
Name of Content Deploy job: CD to Dest.
Source web application.
Destination Central Administration Server with Port number. You must type this in the format: http://servername:port#. Enter in the Authentication Info.
Click the Connect button. 11. After the connection is successful, you can enter the Destination –WebAppD and / as the Destination site collection. Leave the other options as default. Click OK.
189
Content Management 12. Create the job by clicking Create Job in the drop-down list as show in the following screenshot:
13. On the ensuing page, modify the following:
Name: Enter a name for the job
Scope: To select scope: ff
Choose Specific….
ff
Click on the Select Sites button.
ff
The following screenshot appears:
ff
For SiteA, choose Select this branch.
ff
For SiteC, choose Select this site.
Click OK.
Frequency: Check the box for the Run this job…option.
Notification: Check both boxes and enter an e-mail address.
Click OK. 14. Hover over the newly created job CD to Dest and choose Run Now from the drop-down list.
190
Chapter 8
6. Enter the URL of the site collection that was created prior to the beginning of this recipe. It should be of the form http://servername/sites/ContentTypeHub. 7. Check the Report syndication… option and click OK. 8. Click to the right of Managed Metadata Service connection, highlighting the line. Click the Properties option on the ribbon. 9. The Edit Managed Metadata Service Connection pop-up appears. Check the Consumes content types from the Content Type… option; the other three options are checked by default.
Click OK. 10. Open the sites/ContentTypeHub site collection. Click Site Actions and then Site Settings. 11. Under the Galleries section click Site columns. 12. Click Create. In the Name column, call it ArticleHeadline. Keep it as a single line of text and keep the rest of the defaults. Press OK. 13. Navigate back to Site Settings. Under the Galleries section, click Site content types. 14. Click Create. In the Name column, enter Article.
193
Content Management 15. Click on the drop-down for Parent Content Type and choose Publishing Content Types from the Select parent content type from: drop-down. Click OK.
16. A page called Site Content Type Information is presented. Click Add from existing site columns. 17. Add article headline and click OK. 18. Click Manage publishing for this content type. 19. By default Publish is chosen. Click OK. 20. Create a new Site Collection called sites/ContentTypeHubConsume, through Central Administration. Base it on the Publishing Portal Template. 21. Now, when the timer job runs, the new article content type that we just created (ContentTypeHubConsume) will automatically be published to the new site collection.
How it works... The first ten steps in the recipe identify and configure the Content Hub Type site collection in the Managed Metadata Service. All of the content types are published from this hub. In our example, both site collections were created under one web application. The web application is associated with the Managed Metadata Service that was modified in step 3. The rest of the recipe was spent creating a content type called Article. Clicking on the content type in the Site Content Types Gallery shows a new menu item called Manage publishing for this content type under Settings.
194
Chapter 8
8. Click OK.
How it works... External Content Types are created with SharePoint Designer 2010. After it is created there is the management of this entity. This is done through Central Administration by the administrator of the service application or Farm Administrator. The following can be done: ff
Obtaining a listing of all of the External Content Types for a BDC service application instance: This was performed in step 4.
ff
Setting permission for an External Content Type: Covered in step 7.
ff
Deleting an External Content Type: Achieved using the Delete button on the ribbon.
ff
Viewing details of an External Content Type: Click on the External Content Type directly. A list of the fields will appear along with any associations, actions, or filters.
ff
Add an action to an external content type: This is done by hovering over the ECT and choosing the appropriate action from the drop-down list.
ff
Define a profile page: This is achieved with the help of the Configure button on the ribbon.
ff
Creating or updating a profile page for an External Content Type: This is done with the help of the Create/Upgrade button on the ribbon.
197
Chapter 8
6. Select the New Group option from the drop-down list, as shown in the following screenshot:
7. Name the group as Financial Aid. Leave the other fields blank (Description, Group Managers, and Contributors). 8. Hover over Financial Aid and click the drop-down list named New Term Set. 9. Name the new Term Set as Public. Leave the other fields at their default values. 10. Hover over Public and click the drop-down named Create Term. 11. Select the FAFSA option from the Create Term drop-down to get the screen shown here:
12. Click Save.
How it works... Prior to creating a Term Set, a Term Set Group must be created. The group is necessary to organize and secure a collection of Term Sets. In step 7 of the recipe, we could have assigned Group Managers, or Managers and Contributors, who would be responsible for the group Financial Aid.
199
Content Management 6. Fill in the required details on the ensuing page.
Click OK. 7. Click Shared Documents and upload a document to the library if one does not exist. 8. Hover over the document and click on the drop-down item Compliance Details.
204
Chapter 8
9. The following pop-up screen appears:
Click on the Declare as a record link. 10. You will get a pop-up window asking your permission to lock down an item for editing. Click OK. 11. The record is processed and is now shown with a lock on the file icon, as seen in the following screenshot:
How it works... As shown in the recipe, documents stay in their original location when declared as a record. They do not need to be routed to a central location such as Records Center. In the prior recipe, we saw how routing works. In place Records Management is enabled at the site collection level, as shown in step 3. This brought us a new menu item pick that was configured in step 6. There were three sections that allow the configuration of managing records. The first section, Record Restrictions, pertains to the editing and deletion of records. The second section is for the manual declaration of records. If this is marked as Not Available..., then a workflow or policy must be configured to declare a record. This would be done through the use of managed metadata. The last section pertains to the permissions of who can do what. In the recipe shown, all could declare a record but only list administrators could undeclare a record. 205
Content Management
There's more... While the configuration for declaring records was shown at the site collection level, it can be overridden at the document library level. Do this by navigating to the document library and clicking on the document library settings on the ribbon. There is a Record declaration settings menu item under Permissions and Management. Clicking on this brings up the following page:
Clicking OK overrides the site collection settings.
More info In step 9, we used the Compliance menu item in the document drop-down list to declare the document as a record. Another way to accomplish this would be to check the box next to the document, click Documents under Library Tools on the ribbon. There is a button (which has a drop-down list associated) called Declare Record. It is more efficient to use this when there is a need to declare more than one document as a record.
206
Chapter 9
The first part of the recipe (steps 1–8) adds the tag cloud to a page. As we can see in the screenshot of step 8, several terms immediately show up. One of these terms, EBITDA, relates to Chapter 4, Site Administration. Steps 9–15 show us how to navigate back to the Term Store to see from where they originate. In particular, the sample term is shown in the managed metadata taxonomy. This is the term that is surfaced in the tag cloud. In the Term Store management recipe from Chapter 4, we saw how to manage a Term Store, which included how to create terms. The result of these two halves builds a complete picture, showing the full life-cycle of a term, from the store to the tag cloud.
There's more... The I Like It button at the top of the page allows a user to automatically tag a page. When this is done, I Like It is added to the System Term Store as part of the folksonomy.
The button to the right, Tags & Notes, allows a user to tag a page with their own tag and create a public note. This is shown in the following screenshot:
211
Chapter 9
8. Click OK.
How it works... Using Central Administration, the recipe shows how to navigate to the User Profile Service management page. There is no direct way to get to the page; it must be done with the help of the service application as shown in steps 1 to 4. Once there, the section People contains the link to permissions, where the social features can be disabled. Step 7 shows the screen that contains three items per user/group: ff
Use Personal Features: These are items such as My Profile.
ff
Create Personal Site: When unchecked, the user will also not be able to provision a personal site—commonly known as My Site.
ff
Use Social Features: The user cannot use the social features that are part of the SharePoint 2010 project. Items such as the I Like It and Notes button are removed.
Now groups can be created that do not need to have these types of services, for instance, auditors that need access to the system but are not part of the ecosystem of a company. These types of resources are typically only onsite for a short duration with a focus on controls. An administrator must be careful and cognizant to understand that a user may belong to several groups. Therefore, if the permission is deleted from one group, users may still have access via another group. In this recipe, all of the features were removed; you could pick and choose specific features for the groups that exist.
213
Chapter 9
Close the dialog box. 6. Open the Central Administration screen and click Application Management. 7. The third section is Service Applications. Under this section, click Manages service applications. 8. Find User Profile Service Application and left-click to the right of the name— the line will be highlighted. 9. Under the My Site Settings section, click Manage Social Tags and Notes. 10. Fill in the form as shown:
In the Type drop-down list, change the value from Tags to Notes.
Enter Starlight in the Tag/Note Contains text box.
11. Click Find. 12. A listing of any note containing the word Starlight appears. Click the checkbox to the left of the note. 13. Click Delete. A confirmation pop-up window appears. Click Yes.
215
Social Architecture
How it works... Activity feeds are part of the SharePoint 2010 My Sites. A My Site consists of three components as seen in the following screenshot:
ff
My Newsfeed: This is the Activity feed.
ff
My Content: This is where information such as documents, pictures, and pages is stored.
ff
My Profile: This contains the information about items you have tagged, where you fit in the organization, peers, and other sites where you have membership.
There are two types of Activity feeds: ff
Consolidated: This is what the user tracks and is shown on their My Newsfeed page.
ff
Published: These are the user's activities. This is on the My Profile page.
In step 5, it was requested that the user put in any activities that they want their colleagues to know about. The reason behind the type-ahead feature working so efficiently is that the information is saved in the managed metadata service system's Term Store. This is referred to as the folksonomy. This assists in keeping a common terminology in the organization.
There's more... Newsfeeds can be consumed by other readers. For example, Outlook 2010 can consume RSS feeds. The following are examples of the links to use (your links will probably be different): ff
Consolidated: http://mysite/_layouts/activityfeed. aspx?consolidated=true
ff
Published: http://mysite/_layouts/activityfeed. aspx?publisher=
More info As an administrator, it is important to understand that there are three service applications functionally integrated with Activity feeds: ff
Search
ff
User profile
ff
Managed Metadata Service
218
Social Architecture 7. The page to add a rule is now displayed. Fill it the details as shown:
Operand: Select User
Operator: Select Member Of
Value: Type the name of the Active Directory group that you created— domain/na_hourly
Click OK. 8. The Audience Properties page is displayed. Click Compile audience under that section.
How it works... Audiences have a dependency on the user profile service application being configured and operational. As seen in step 7, a rule can be set up for either a User or Property parameter. The recipe discussed here uses the User parameter. The operator is dependent on the aforementioned parameter. As User has been chosen here as the parameter, there are two possibilities: ff
Reports Under: This is a UserID—typically a manager of some type. Using this is an indication that AD and the properties are configured.
ff
Member Of: Allows the use of a windows security group or distribution list.
Choosing Property as operand changes the value of Operator as well as of the Value setting. The first decision to be made should be which user property to choose. The operator consists of the values shown in the following screenshot:
220
Chapter 9
Finally, a value is chosen that is part of the domain. This illuminates the two types of audiences in SharePoint 2010: ff
Global audiences: Property under the Operand setting. This is creating a rule based on the properties in the user profile. Elements are set, but as will be shown in another recipe, the administrator can create an element based on need.
ff
Windows Security Groups and distribution lists: User parameter under the Operand setting. This is creating a rule based on security groups and distribution lists. The creation of these items is not typically done by a SharePoint Administrator.
It has been stated many times, but still is crucial enough to be repeated again: the use of audiences does not secure data. With a link, users can navigate to content that is not meant to be seen by them.
There's more... Using the user profile navigation that was shown in this recipe, audiences can be managed. The following screenshot shows the audience that was created and information about it such as Last Compiled and Description.
Furthermore, by hovering over the audience, there is a drop-down that helps with the following operations: ff
Edit: Name, description, and owner of the audience can be changed, except the rule. After clicking OK, the screen with the operand is shown under the section audience rules. Clicking on operand here will allow you to modify the rule.
ff
View Properties: This navigates to the properties of the audience. Here, the administrator can get particular information about the audience such as Create Time. Also, all of the options in the drop-down list are available here.
ff
Delete: Administrator can delete the audience.
ff
View Membership: This is a screen of the members of this audience.
ff
Compile: Allows the administrator to compile the audience. 221
Chapter 9
6. The following page is displayed:
Fill in the required information.
Connection Name: ADUsers.
Type: Active Directory.
Forest name: Enter the name of your forest (that is, domain.com).
Authentication Provider Type: Windows Authentication (by default).
Account name: This should be in the form of domain/administrator.
Password: Type in the password required to access the account.
Confirm password: Confirm the password you have typed in the Password field.
7. Click Populate Containers. 8. Click the OU container that contains the account you want to import. Do no click Select All. 9. Click OK. 10. Navigate back to User Profile Administration. 11. Under the Synchronization section, click Start Profile Synchronization.
223
Social Architecture 12. If this is not the first time synchronization is being run, ensure that the Start Incremental Synchronization radio button is chosen on the synchronization page. Click OK.
How it works... Synchronization is the process of updating profile information in SharePoint from a directory or business application. SharePoint 2010 has a functional process that accomplishes this task. Synchronization functionality relies on timer jobs. The User Profile Service must be started in order for the jobs to run properly. The timer jobs let the User Profile Service interface with three databases: ff
Social DB
ff
Profile DB
ff
Sync DB
Information is updated based on the mapping direction (Import/Export) in the user profile. The account name used in step 6 needs to have Replicating Directory Changes permission on the domain.
There's more... To ensure that the User Profile Synchronization Service is running, follow these steps: 1. In Central Administration, click Manage Services on server under the section named Service Applications. 2. Navigate to the User Profile Synchronization Service as seen in the following screenshot:
3. Click Start.
More info The User Profile Service cannot utilize managed accounts.
224
Chapter 9
How to do it... 1. Open the Central Administration screen and click Application Management. 2. The third section is Service Applications. Under this section, click Manage service applications. 3. Find User Profile Service Application and left-click to the right of the name— the line will be highlighted. Click Manage on the ribbon. 4. Under the section named People, click Manage User Sub-types. 5. The following page will be displayed:
Enter the value as Consultant for the Name as well as the Display Name… field. 6. Click Create.
How it works... SharePoint 2010 creates everyone under the Default User Profile Subtype. All subtypes show up under the Remove Existing Sub-types section as shown in the following screenshot:
The administrator simply needs to select the subtype and click Remove.
There's more... When editing a user's profile, the administrator can reclassify them by subtype. A drop-down appears at the top of the edit page. The administrator can change the subtype and then click Save.
227
Chapter 9
3. Find the User Profile Service Application and click to the right of the name—the line will be highlighted. 4. Under the People section, click Manage User Properties. 5. Click New Property. 6. The following screenshot is displayed. Fill in as directed. (Due to the size of the screen, it has been separated into two parts.)
Name: BranchOffice
Display Name: Branch Office
Type: string
Length: 60
Sub-type of Profile: Leave as checked
User Description: Bank Branch office
Policy Setting: Required
Default Privacy Setting: Everyone
User can override: Leave unchecked
Edit Settings: Choose Do not allow users to edit values for this property 229
Social Architecture
Display Settings: Check all three boxes that start with Show…
Search Settings: Leave the Indexed option checked
Click OK.
How it works... After completing the recipe, Branch Office shows as a mandatory field in the user profile. In addition, the property is now part of the newsfeed for everyone to see. See the next screenshot from the Newsfeed section:
User profiles are saved in the user profile database. This information is collected by a timer job. Combining information from the social database, the information is collected into the user profile database for activity feeds. The timer job User Profile Service Application – Activity Feed Job must be running (enabled) in order for this information to be populated properly in the Newsfeed. In the example we have just seen, we did not map this field to an active directory field. This means the user profile sync will have no bearing either way (Import or Export) on this property. 230
Chapter 9
There's more... Outlook 2010 has the ability to display a SharePoint Activity feed.
231
Backup and Restore 5. The Web Application General Settings page pops up. Scroll down to the Recycle Bin section, as seen in the following screenshot:
6. Make sure the After option is selected under the Delete items in the Recycle Bin setting. Change the value of the Delete items… setting from 30 days (default value) to 15 days. Click OK.
How it works... The Recycle Bin is a library. The first stage Recycle Bin is tied to the user. The second stage Recycle Bin is scoped at the site collection level. This means that a Site Collection Administrator needs to be involved in order to retrieve a document from the second stage Recycle Bin. This Recycle Bin has two views: ff
End user Recycle Bin items: This shows the documents deleted by users that are in their Recycle Bins.
ff
Deleted from end user Recycle Bin: This shows documents that are no longer in a user's Recycle Bin and are only available to the Site Collection Administrator.
There's more... A Site Collection Administrator can view Recycle Bin items by following these steps: 1. Navigate to the site collection web page. This is the root website that was created after creation of a web application. 2. Click Site Actions. 3. Under the Site Collection Administration section, click Recycle Bin. Now the administrator can either restore or delete an item, they can also empty the Recycle Bin. 236
Backup and Restore 3. The following page is displayed. Fill in the required details.
Site Collection: Choose the name of the site collection from the drop-down list. File location: Enter a name for the file. Click the Overwrite… box if appropriate.
Click OK.
How it works... This functionality is useful for backing up site collections and its contents. This includes lists and content, permissions, feature settings, and sites. This data is written to a file that can be used in the restore action process. When navigating to the backup page, there is a section called Readiness at the top. This shows any running instances of the backup. It also shows the timer service status. Finally, after clicking OK, the process navigates the user to the Granular Backup Job Status page. This shows anything in process, along with any previous jobs that were run and the status of these jobs.
There's more... PowerShell can be used to back up a site collection. The following is the command: backup-spsite -identity http://domain/sites/scname -path \\server\backup\ file.bak
More info The Central Administration application pool account must have full access to the backup folder. 238
Backup and Restore Fill in the required data.
Site Collection: Select the site collection where the site is located.
Site: Select the subsite from the drop-down list.
List: Leave at No selection.
File location: Enter a name for the file. Check the Overwrite… option if appropriate.
Export Full Security: Leave this unchecked.
Export Versions: Leave at All Versions.
Click OK.
How it works... Export sites takes all the site objects including installed features, files (pages and content), lists, and all child sites and the associated content. The administrator must choose an existing site collection and site. Leaving the List value at No selection, implies that we will be exporting all of the lists. Versions are a component of lists and have no bearing in the above recipe. If a list is being exported, there are four options to choose from for versioning: All Versions, Last Major, Current Version, and Last Minor. Finally, an export log is created in the directory where the backup is located. This log shows all the assets that were exported, along with the order in which they were exported. It will also show an error if we try to overwrite a file that already exists, and if the checkbox that allows the overwriting of files (Overwrite existing files) is not checked.
There's more... PowerShell can be used to script the exports instead of doing them one by one in Central Administration. The command for site import is: Export–SPWeb http://domain/sites/ts/teamsite -Path \\server\backup\file. bak
The command for item export using PowerShell is: Export–SPWeb http://domain/sites/ts/teamsite -ItemURL "Lists/ Announcements" -Path \\server\backup\file.bak
240
Backup and Restore 4. The same screen appears as was shown in the third step of the Exporting sites recipe. This time we will export a list item.
Site Collection: Select the site collection where the site is located.
Site: Select the subsite from the drop-down list.
Lists: Choose the Announcements list option.
File location: Enter a name for the file. Check the Overwrite existing files option if appropriate.
Export Full Security: Leave this unchecked.
Export Versions: Leave at All Versions.
Click OK.
How it works... The operation shown in this recipe works in exactly the same way as the Export sites recipe. The only difference is that the content database is not attached to a web application and is accessible through the browser. The other key difference being that information can be accessed from a content database snapshot. Do not confuse unattached with detaching a database in SQL Server. This is not the same operation and this functionality will not work on a detached database. You have the option to pick one of three ways to specify what you are recovering: ff
Browse Content: This allows you to see the site collections and lists within a content database.
ff
Backup a site collection: Gives the option to back up a site collection.
ff
Export site or list: This is the same as what was shown in the Export sites recipe.
After the information is retrieved, use the Import sites recipe in order to upload the information to another content database.
There's more... PowerShell can be used to create a snapshot of the content database. Snapshots are supported in the Enterprise version of SQL Server. Briefly, a snapshot is a picture of the database frozen in a point of time. It is read only. Snapshots are a great help for reporting, testing, and updates. It is important to understand that a database cannot be dropped, detached, or restored when it has a snapshot. The following commands show how to create a snapshot. 244
Chapter 10
Backup Component: No action is required.
Backup Type: Select Full.
Back Up Only Configuration Settings: Select Back up content and configuration settings. Backup File Location: Enter in a location for the backup.
7. Click Start Backup.
How it works... The backup through Central Administration (as shown) initiates a SQL Server backup of content. Content is not being referred to here as just the content database, but it encompasses service application databases, the configuration database, and search assets. In step 5, there were several parameters to the backup. The first thing is deciding between a full and a differential backup. The difference is that a differential backup stores the changes only from the last backup. A full backup is just that, everything. The second choice is the ability to back up only the configuration settings. This backs up the configuration database. The other data choice was to back up the configuration and content. This is more likely to be the scenario that will be chosen. When the backup is started, a running list of all the assets is kept up to date in the Backup and Restore Job Status page. When the process is finished, it will indicate success or failure. Even if one content database fails and everything else succeeds, the process will report failure.
There's more... It is important to understand that the service application and the service proxies are backed up separately, even though you may have installed a component and created a proxy such as the managed metadata service. To back up one service at a time, select either of the checkboxes under Shared Services; on the other hand, to back up both together, check both the checkboxes under Shared Services.
247
Backup and Restore There may be times when you want to back up one of the service applications and its associated proxy. To do this, you must expand both Share Services Applications and Shared Services Proxies, and pick the related service application and proxy. Furthermore, many service application databases cannot be backed up individually. To do this, a SQL Server backup must be configured and scheduled.
More info Under the Backup and Restore section, there is a menu item called Configure Backup Settings. The following screenshot shows what the page consists of:
Threading is an operating system construct that represents an independent execution mechanism. The more threads the process is given, the better the performance. However, conversely the more threads, the more communication, which translates to more information in the logs. Both backup and restore are given a default number of threads. In the preceding screenshot, both the backup as well as the restore threads stand at 3. The Backup location is the third setting that can be configured.
248
Backup and Restore 6. A detailed restore listing will be presented, which consists of five options.
Restore Component: This will be farm. Restore Only Configuration Settings: The choice to restore configuration, or both content and configuration. Choose both. Restore Options: Click Same configuration. Click OK to the resulting confirmation dialog. Login Names and Passwords: You need to provide the password for the content databases and service applications. New Names: This is predicated on the Restore Options. When the Same configuration option is chosen, these controls are disabled. Click Start Restore.
How it works... As the restore is running, the process status can be viewed from the Backup and Restore Job Status page. Timer service jobs run the restore. In the event of errors, the failure message column will enumerate the nature of the issue. If more details are needed, the sprestore. log file in the backup directory will further clarify the failure. Restore works on an apples to apples basis. This means if a single server farm is being restored, it must be done from a single server backup. Likewise, a multiple server farm backup cannot be restored into a single server farm. The service applications that are restored will not be automatically started. They must be manually started using Central Administration (Manage Services on server) or PowerShell. Any trust relationships that existed must be redone.
There's more... When restoring the farm, there are several items that must be done manually: ff
Alternate access mapping setting must be recreated
ff
External data sources, used by BCS, must be reconfigured
ff
Proxy groups must be reconfigured to have a correct association with the service application proxies
ff
Web application must be configured with the proxy groups
250
Chapter 10
More info PowerShell can be used to perform the restore. It must be done with the Farm account's credentials, using the following command: Restore-SPFarm -Directory -RestoreMethod Overwrite [-BackupId ]
251
Performance Monitoring The obvious place to put the CQWP is on the home page. One day, the administrator gets reports from users of the page hosting this web part having performance issues; users report page timeouts to the administrator and they report strange information on the page. The administrator must go through a list of possible causes. The causes might include: ff
Is the problem how many sites CQWP traverses to display data?
ff
Has the CQWP been customized to bring custom fields back?
ff
Does the CQWP bring back only the fields that were specified?
ff
Was a custom query written using CAML and put into the CQWP? If so, how efficient is that query?
ff
Were there any overrides, and if yes, what were they and how can they affect performance?
ff
How many CQWPs are being used on one page?
The point being made here is that this is an out of the box web part and there is a lot that a user can do with it that can affect page load time. Server-side code introduces a different complexity, such as the possibility of memory leaks. Memory leaks in a system are like termites—you don't notice them at first, but when you do, your system seems out of resources. Like termites, identifying and getting rid of system leaks is a major pain point and cannot be easily done. SharePoint has a best practice analyzer included with Central Administration, which has been covered in Chapter 5, Monitoring and Reporting, under the recipe named Editing rule definitions in health analyzer. This is powerful and extensible and provides critical information to the administrator on the health of the farm. But just like the carpenter who could build a house with just a hammer, there are other powerful tools that supplement the health analyzer. These tools are found outside of SharePoint and help the administrator to perform his/her duties more efficiently. The tools will point to other possible issues such as memory leaks and page load times that affect SharePoint. This gives you, as an administrator, a broad picture of the possible issues. Once these issues are identified, there should be possible resolutions. One such tool featured in the recipes here does just that. The tool is named Virtual Round Trip Analyzer. It provides the suggested best practices. These tools should be used carefully and in conjunction with each other. Becoming knowledgeable on what is available and how to utilize them will arm you with the information you need, making you a smart SharePoint 2010 administrator.
254
Performance Monitoring 5. At the bottom of the ensuing pop-up screen, there is a section as shown in the following screenshot:
Select the On option. 6. Click OK. 7. On the publishing farm server, select click Start | All Programs | Microsoft SharePoint 2010 Products | SharePoint 2010 Management Shell. 8. In the PowerShell command prompt, type in the following commands: $setting = (Get-SPWebApplication "http://server"). HttpthrottleSettings $settings
The output of the command is shown in the following screenshot:
256
Chapter 11
How it works... When Request Throttling is enabled, the state of each web frontend server is evaluated at a request level. A request is the information asked for on the web frontend by the user and then sent to SQL Server. Throttling is enabled at a web application level, as shown in steps 1 to 6. Several metrics are sampled and a server health score of 0 to 10 is assigned to the request. The higher the score, the worse the state of the server. Throttling is implemented when the score is 10. At this point, any new web page will result in a 503 error. Administrators know the 503 error page indicates that the servers have no more resources to satisfy the request. Steps 7 and 8 show how to access the SPHttpthrottleSettings object. This is where the settings for throttling are set. The settings are as follows: ff
RefreshInterval: Amount of time between samples. The preceding screenshot shows the time set to five seconds (5000 miliseconds).
ff
NumberOfSample: Samples of each counter are collected for measurement. These are weighted and used in an algorithm that cannot be modified. The default is twelve samples per minute.
ff
ThrottleClassifiers: Set of rules that classify requests.
ff
PerformanceMonitors: Specifies the counters associated with HTTP Request Monitoring and Throttling.
ff
PerformThrottle: This turns on or off request throttling for the web application specified. Display true for enabled.
There's more... With PowerShell, you can see as well as set the performance counters that SharePoint is currently utilizing. Use the following command to see the Throttling settings: Get-SPWebApplicationHttpThrottlingMonitors http://yourserver
Use the following command to set the Throttling settings: Set-SPWebApplicationHttpThrottlingMonitors-URL
257
Chapter 11
Fill in the required information.
Trace Name: SPTrace.
Use the template: Leave it to the default value: Standard.
Save to file: Check this box. A filename automatically appears; save this location.
6. Click Run. 7. Add a list item to a list in your SharePoint team site. 8. Click on the Stop Selected Trace button
on the menu.
How it works... SQL Profiler attaches to an instance of your database. It can then interrogate and report on every event that takes place in that database. We need to be aware that Profiler will show activity on all the databases, which includes everything from the social databases to managed metadata to search—a lot of information to collect. When you first clicked Run in the sixth step, the trace began immediately. You may have noticed how much communication there was between SharePoint 2010 and the SQL Server; even the shortest of traces produces voluminous data.
259
Performance Monitoring 5. Follow the same process as step 3 for the following counters:
ASP.NET Application: Request Rejected, Requests Timed Out
SharePoint Disk-Based Cache: Total blob disk size
You should see a screen similar to the following screenshot:
6. Click OK.
How it works... Performance Monitor shows specific performance counters in a graphical view. It works in real time so that you can monitor the health of your servers. As can be seen when choosing a counter, there are hundreds of counters. Each counter is assigned a different color and with that you can delineate which line in the graph represents which counter. The counters can be selected not only one at a time, but also by group by holding down the Ctrl key. The ribbon toolbar shown in the screenshot can be used for the following: ff
View Current Activity: Real-time view of counters.
ff
View Log Data: Enables user to create a log file.
ff
Change Graph Type: Three different types: Line, Histogram, or Report.
ff
Add: Adds counters.
ff
Delete: Removes counters.
ff
Highlight: Click on a counter and then click highlight. This highlights the counter. It is a useful setting for focusing on a particular measure.
ff
Copy Properties: Creates a copy of the current selected counter and its properties.
ff
Paste Counter List: Imports counter settings from the clipboard. This is helpful when you have more than one server that is being monitored.
262
Chapter 11 ff
Properties: Shows a dialog that enables the user to change the color of a line, scale, width, and style, along with adding and removing of counters. In addition, things such as the graph can be changed in a multitude of ways.
ff
Freeze the display: Conversely, you can then update the display or enable it in real-time again.
There's more... If you have to go and select counters each time you need to run Performance Monitor, it is an indication of inefficient functioning. For your server instance, through trial, you will find the set of counters that give you the information you need. Windows 2008 has the ability to create a Data Collector Set. This is a group of counters that you have defined and saved. In Performance Monitor, on the left-hand side, there is a console tree that looks like the following screenshot:
Right-click on the User Defined option under Data Collector Sets. Click New and a wizard guides you to create a collection of counters. Once the collection is created, the Data Collector Set will be shown under the User Defined option. By right-clicking on it, you can select the Start option and begin the monitoring task.
More info Microsoft has created many performance counters. As you navigate through the list, you will see the counters related to SharePoint, FAST (if installed), and WSS.
263
Performance Monitoring ff
Images on a home page
ff
Files that need to be downloaded (CSS, JavaScript, and so on)
Using the four tabs, Main Chart, Statistics, All Files, and Analysis, the data the page is retrieving and loading can be seen in detail. In the preceding screenshot, every file that is loaded shows how long to load, the port, the type of file, a status code, and size. Armed with this information, the administrator can observe the assets that are being used and be able to offer recommendations such as creating a sprite instead of loading each individual image, or combining JavaScript files. Hovering over each detail item will present further detail on the individual asset. VRTA also has an Analysis tab that acts as a best practice guide. It grades the files and page on several basic factors such as an average file size rule, white spaces rule, and image clustering rule. Using a color-coded scheme, it makes recommendations to help you improve performance. Finally, every time a recording is made, it is saved in a directory by default, whose path can be seen in the title of the VRTA application.
There's more... The reason to start with about:blank is that IE will reload the page automatically and won't use cache. This will give you a real representation of your SharePoint 2010 application.
266
Index Symbols $_ notation 138 $teamsite variable 103 .aspx pages 160 <noun> naming pattern 169
A Active Directory (AD) 80 activity feed consolidated 218 published 218 types 218 viewing 216-218 addcontentdb stsadm command 11 Add-PSSnapin cmdlet 169 advanced routing (content organizer) configuring 180-185 Alternate Access Mapping (AAM) creating 29, 30 AssetListCT 114
B backup restoring from, in central administration 249-251
C central administration backup, restoring from 249-251 farm, backing up 245-248 recycle bin, settings 235, 236 column adding, with managed metadata property 108-110
comma-separated values (CSV) file 201 consolidated activity feed 218 content database configuring 26, 28 database capacity settings section 28 database information section 27 failover server section 28 preferred server for timer jobs section 28 remove content database section 28 search server section 28 content deployment configuring 188-190 Content Query Web Part (CQWP) 253 content type hub adding 192-195 content type subscriber 195 correlation IDs troubleshooting with 137, 138 corruption 234 crawl database adding 154-157 crawler indexer component 144 crawl reports viewing 159, 160 CreditApplicationCT 114 customized reports 136 custom security creating, for service 44-47 custom service application proxy group creating 47-49
D data about 233 recovering, from unattached content database 242-244
db_owner database role 100, 102 Developer Dashboard enabling 139, 140 DocumentID 151 documents routing, to another site 185-187 document set configuring 113-117 Drop Off Library option 184
E Edit Setting property 226 Enterprise Wiki setting up 121-123 Excel services setting up 51-55 export for user profiles, changing 225, 226 External Content Type (ECT) 195 external content types managing 195-198
F farm consuming farm 67 in central administration, backing up 245248 publishing farm 67, 68 trust relationship, establishing 66 web part access, restricting 90, 91 farms service consuming 72-74 farm-wide feature installing 88-90 Fast Search Server 2010 144 financial term 110 First Search Server 2010 144
G Get-SPUser command 169 Get-SPWebTemplate 103 Global Assembly Cache (GAC) 133 governance 75 group 107 268
H hardware 233 health analyzer enabled parameter 132 new health rule, adding 133 repair automatically parameter 133 rule definitions, editing 130, 132 schedule parameter 132 scope parameter 132 title parameter 132 version parameter 133 host distribution rule adding 157-159 HTTP request monitoring enabling 255-257 HTTP request throttling enabling 255-257
I iisreset operation 101 I Like It button 208, 211 import for user profiles, changing 225, 226 import term set 108 in place records management 203-206
J job timer job management 92-94
L lockdown mode setting, for publishing sites 174, 175 logging database, SharePoint 2010 about 128-130 accessing 126-128
M Managed Account configuring 80, 81 Managed Metadata (EBITDA) 183 managed metadata property column, adding with 108-110
Managed Metadata Service application 210 Managed Metadata Service (MMS) setting up 63-66 Metadata Threshold property 165 Microsoft.SharePoint.Administration.Health namespace 133 Mortgage Active URL 118 Mortgages Archived URL 118 MOSS 2007 database attach upgrade 11 in-place upgrade 11 upgrading, to SharePoint 2010 11-17 Move-SPUser command 169 multiple Send To connections configuring 118-120
N New-SPSite 103 New-SPSite command 104 note associated with page, deleting 214, 215 NumberOfSample 257
P patching (compatibility boundaries) about 31, 32 database schema versions 33 database status 33 patch status 33 performance monitor monitoring with 260-263 PerformanceMonitors 257 PerformancePoint services setting up 56-60 PerformThrottle 257 permission UI checking 172, 173 policy creating, for web application policy, creating for 82-84 PowerShell about 101 managed account, deleting 82
managed accounts, list 82 new account, creating 82 Performance Counters, setting 87 Performance Counters, view list 87 permissions, delegating 170-172 Resource Throttling, disabling 87 Resource Throttling, enabling 87 set 82 time jobs, list getting 94 timer job, disabling 94 timer job, enabling 94 timer job parameters, setting 94 timer job, starting 96 UI version, changing with 22 used, for adding user 168, 169 preupgradecheck 9, 12 preupgradecheck rule files parameter 11 property database adding 152, 153 published activity feed 218
Q query component adding 149-151 query server component 144
R recycle bin settings, in central administration 235, 236 refinement pane customizing 161-165 custom refiner, creating 163, 164 managed property, creating 162 RefreshInterval 257 Remove-SPUser command 169 Request for Quote (RFQ) 118 RequestUsage 127 RequiredPermissions parameter 140 Resource Throttling configuring 85-87 disabling 87 enabling 87 rule definitions in health analyzer, editing 130, 132
269
S SalesContractCT 114 sample term 211 Sandbox functionality about 99 configuring 97, 98 SAPGFinancial group option 50 search query viewing 159, 160 Search Server Express 2010 143 search service about 143 components 144 crawl database, adding 154-157 crawl reports, viewing 159, 160 Fast Search Server 2010 144 host distribution rule, adding 157-159 managing 146-148 new content account 149 property database, adding 152, 153 query component, adding 149-151 refinement pane, customizing 161-165 search query, viewing 159, 160 Search Server Express 2010 143 setting up 144-146 SharePoint Search Server 2010 144 search service, components crawler (indexer) 144 property database 144 query server 144 secure store service creating 41-43 security policy reports accessing 177, 178 Security Token Service (STS) certificate 68 Send To connections. See multiple Send To connections service application associations, managing 49-51 custom security, creating 44-47 custom service application proxy group creating 47-49 deleting 39 Excel services, setting up 51-55 farms service, consuming 72-74
270
Managed Metadata Service (MMS), setting up 63-66 Manage Service Application page 40 managing 37-40 PerformancePoint services, setting up 56-60 secure store service, creating 41, 43 SharePoint Service publishing 69-71 Visio services, setting up 60, 62 service application associations managing 49-51 Set-SPUser command 169 Shared Service Provider (SSP) 35, 36 SharePoint 2010 about 8, 125, 126 activity feed, viewing 216-218 advanced routing (content organizer), configuring 180-185 Alternate Access Mapping (AAM), creating 29, 30 backup and recovery solution 235 content database, configuring 26, 28 content deployment, configuring 188-190 content type hub, adding 192-195 correlation IDs, troubleshooting with 137, 138 current installation upgradeability, checking 8-11 Developer Dashboard, enabling 139-141 documents, routing to another site 185-187 export for user profiles, changing 225, 226 external content types, managing 195-198 import for user profiles, changing 225, 226 in place records management 203-206 lockdown mode, setting for publishing sites 174, 175 logging database 128-130 logging database, accessing 126-128 MOSS 2007, upgrading errors 17 MOSS 2007, upgrading to SharePoint 2010 11-16 note associated with page, deleting 214, 215 permission UI, checking 172, 173 PowerShell permissions, delegating 170-172 rule definitions in health analyzer, editing 130-133
search service 143 security 167, 168 security policy reports, accessing 177, 178 site configuration audit settings, configuring 175-177 sites, exporting 239, 240 sites, importing 241, 242 social features for user, disabling 212-214 synchronization connection, creating 222-224 tag cloud, navigating to term store 208-211 tag cloud, setting up 208-211 term set, creating 198-200 term set, importing 201-203 UI Version, changing with PowerShell 22 upgrading, with minimal downtime 18, 19 user, adding via PowerShell 168, 169 user subtype, adding for user profiles 226, 227 visual upgrade 20, 21 web analytics reports, viewing 133, 135 SharePoint Designer administering 76-79 SharePoint Search Server 2010 144 SharePoint Service publishing 69-71 SharePoint_Shell_Access database role 139 SharePoint_Shell_Access role 100, 168, 171, 174 SharePoint social, elements activities 208 profile and context 208 users relationships 208 Single Line of Text property 161 site provisioning, via Windows PowerShell 102, 103, 104 site collection about 100 migrating 100-102 site collection backup performing 237, 238 site collection policy prerequisites 111 setting up 111-113 site collection recycle bin about 235, 236
site configuration audit settings configuring 175-177 sites exporting 239, 240 importing 241, 242 social features disabling, for users 212-214 SocialRibbonControl feature 214 SPEnterprisesearchserviceapplication cmdlet 148 SQL Profiler 258-260 storyboard 60 subsite about 100 synchronization connection creating 222-224
T tag cloud navigating, to term store 208-211 setting up 208-211 term set about 107 creating 198, 200 importing 201-203 term store 109 tag cloud, navigating to 208-211 term store management 104-107 ThrottleClassifiers 257 timer job management about 92-94 timer job, running 95, 96 troubleshooting with correlation IDs 137, 138
U unattached content database data, recovering from 242-244 Unified Logging Service (ULS) 125 user adding, via PowerShell 168, 169 user profiles user subtype, adding for 226, 227 user subtype adding, for user profiles 226, 227 271
V ViewFormPagesLockdown 175 viruses 234 Visio services setting up 60, 62 Visual Round Trip Analyzer (VRTA) about 264, 265, 266 application developers 264 end users 264 web developers 264
W web analytics reports viewing 133, 135 web analytics service application infrastructure components 135 web application policy, creating for 82, 84 web front-end (WFE) 31, 47
272
web part security 90 web part zone 90 Windows Communication Foundation (WCF) 40 Windows PowerShell site, provisioning 102-104 WSS_ADMIN_WPG 100 WSS_ADMIN_WPG local group 137, 139 WSS_ADMIN_WPG local security group 171 WSS_Logging 126
X XML file 195
Z zones option 84