Chapter 12. SharePoint Operations and Administration

Throughout this book, you have used the Central Administration web site to manage web applications, site collections, and users. However, administration and maintenance in SharePoint go beyond simply creating new web sites. Just like any other critical business system in your organization, SharePoint requires a comprehensive maintenance plan to protect corporate data and ensure optimal performance. In this chapter, I will examine the major administrative tasks you must perform to keep a SharePoint installation healthy.

Using Backup and Restore

One of the first things that you will want to configure in a production environment is proper backup of the SharePoint installation. Backup and recovery is performed manually through the Central Administration interface via the Operations tab. Here you will find a Backup and Restore section with several links. You can also create a script to automate the backup process using the command-line utility STSADM.EXE. You'll find a brief discussion of STSADM.EXE in the section titled "Using the Command-Line Utility" later in the chapter. In this section, I present the process for performing a manual backup and restore.

Creating a Target Folder

When backups are performed, SharePoint saves the configuration and content information as a series of files. These files are saved to a target directory, which must have appropriate permissions established for the backup to succeed. Therefore, you should create a network location for backup data before beginning your first backup operation. Generally this means creating a folder and granting rights to the following key accounts:

  • The account under which SQL Server 2005 is running

  • The account under which you will log in to manually run backup jobs

  • The server from where you will access the Central Administration site

  • The account running the Shared Services pool

  • The account running the Central Administration application pool

Note

If you are running SQL Server 2005 under the Local System account, which is the configuration described in Chapter 2, you'll need to grant the computer running SQL Server access to the folder.

Follow these steps to create a network backup location:

  1. Log in to VSSQL as a domain administrator.

  2. Open the File Explorer and create a new directory at the location C:SharePointBackups.

  3. Right-click the SharePointBackups folder and select Properties from the context menu.

  4. In the Properties dialog, click the Sharing tab.

  5. On the Sharing tab, select the option labeled Share This Folder.

  6. Click the Security tab.

  7. Click the Add button.

  8. In the Select Users, Computers, or Groups dialog, click the Object Types button.

  9. In the Object Types dialog, check the Computers box and click the OK button.

  10. In the Select Users, Computers, or Groups dialog, type VSSQL;VSMOSS;Administrator;SPConfigAcct;SPSharedServicesPool and click the Check Names button.

  11. When the names are resolved, click the OK button.

  12. Select the VSSQL account and grant the Modify, Read & Execute, List Folder Contents, Read, and Write permissions.

  13. Grant these same permissions to the VSMOSS and Administrator accounts.

  14. Click the Sharing tab.

  15. Click the Permissions button.

  16. In the Permissions dialog, click the Add button.

  17. In the Select Users, Computers, or Groups dialog, click the Object Types button.

  18. In the Object Types dialog, check the Computers box and click the OK button.

  19. In the Select Users, Computers, or Groups dialog, type VSSQL;VSMOSS;Administrator;SPConfigAcct;SPSharedServicesPool and click the Check Names button.

  20. When the names are resolved, click the OK button.

  21. Select the VSSQL account and grant the Change and Read permissions.

  22. Grant these same permissions to the VSMOSS and Administrator accounts.

  23. In the Properties dialog, click the OK button.

Performing a Backup

Once the network folder is set up with the proper permissions, you can initiate a backup. The backup and recovery utility is primarily focused on information contained in the content database. The backup utility does not back up the configuration database, external files such as web part assemblies, or custom features you deployed. Therefore, you should also have a plan to back up all of the servers in the farm and all SQL Server databases.

Follow these steps to back up your farm:

  1. Log in to VSMOSS as a farm administrator.

  2. Select Start

    Performing a Backup
  3. When the Central Administration site opens, click the Operations tab.

  4. On the Operations tab, click the link titled Perform a Backup.

  5. On the Perform a Backup page, check the box next to the Farm item. This selects the entire farm for backup.

  6. Click the link titled Continue to Backup Options.

  7. On the Start Backup page, enter \VSSQLSharePointBackups in the Backup Location field. Figure 12-1 shows this page.

  8. Click the OK button.

When you initiate a backup, SharePoint schedules the job for execution by the Windows SharePoint Services Timer service. Therefore, the job may not start for a couple of minutes after you initiate it. The Timer service runs under the same account as the Central Administration site pool and is responsible for executing all scheduled jobs. You can see a list of scheduled jobs by clicking the link titled Timer Job Definitions on the Operations tab.

While the backup is executing, the status will be shown as the page is periodically refreshed. If the job runs successfully, you will see each part of the backup indicate completion. If the job fails, the page will reflect the error and abort the backup. In order to start a new backup, you must delete the failed backup job from the list of job definitions.

Starting a backup

Figure 12.1. Starting a backup

Performing a Restore

Once you have a backup package, you may use it to restore all or part of a SharePoint farm. Clicking the link titled Restore from Backup on the Operations tab will take you through a series of pages where you can select the backup package that you want to restore and the portions of the farm to restore. You can use the backup package to restore to the same farm or a different farm, which is an excellent way to move content from a development environment into a production environment.

Using Logs and Reports

SharePoint utilizes logs to track key events, errors, and usage for the farm, site collections, and sites. SharePoint logs are an excellent tool for troubleshooting operations and identifying problems with your own custom applications. SharePoint logs can also be enabled to track usage data in the farm so that you can analyze the traffic for sites. In this section, I explain how to enable and configure the different logging and reporting mechanisms in SharePoint.

Working with the Unified Logging Service

When you are working with a SharePoint installation, you will undoubtedly experience errors on pages or issues with configurations that you do not immediately understand. For example, you may find that your profile imports are not running as expected or your search index is not being properly built. If you have a custom feature involved, the situation may be even more complicated. In all of these cases, you'll need good logging information to sort out the problem.

Oftentimes, SharePoint components will make entries in the Application, System, or Security event logs. In fact, I have recommended that your components do the same. This information can be invaluable in troubleshooting a problem. However, SharePoint also maintains a separate logging system called the Unified Logging Service (ULS).

The ULS is a farmwide logging service that can be used by every SharePoint component. It consists of a series of text files located in the path C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12LOGS. Here you will find many text files with a LOG extension that contain entries from the mundane to the critical. When things go wrong with SharePoint, the answer can often be found in these logs.

The Central Administration site provides configuration settings for the ULS that you can change to help provide better information when troubleshooting. You can access the ULS configuration settings from the Operations tab by clicking the Diagnostic Logging link. Figure 12-2 shows the settings page.

On the Diagnostic Logging page, you will see settings that allow you to participate in the Microsoft Customer Experience Improvement Program and collect error reports for delivery to Microsoft. The Customer Experience Improvement Program is a way for you to provide usage information anonymously to Microsoft. This data is used to determine what parts of the product are used most often and for direct development of the next version. The error reports are used by Microsoft to help identify and correct common problems. These programs are similar to ones that you may have seen for other products such as Office.

The last two sections of the Diagnostic Logging page are used to configure the ULS. The Event Throttling section is used to limit the entries that are made to the ULS, and the Trace Log section is used to determine the maximum number of log files to create and how long an individual log should be kept in use. These settings are important because the log files can become quite large if left unchecked.

The log files are created as tab-delimited text and contain the fields Timestamp, Process, TID, Area, Category, EventID, Level, Message, and Correlation. You can start to troubleshoot issues by looking for entries around the time that an issue occurred. However, if you have not throttled the logs, you will see many entries, so the time stamp may not be that useful. The category information is more useful because it contains specific identifiers for SharePoint components, such as Business Data for the BDC. You can also search for messages with a High or Critical level, which are often associated with operational problems.

Unfortunately, SharePoint does not come with a viewer for the ULS. Therefore, the only way to view the logs is to open them in Notepad or import them into Excel. At the end of this chapter, I have included an exercise that you can do to build a ULS viewer feature. This feature allows you to view and filter the ULS from within the Central Administration site.

Configuring the Unified Logging Service

Figure 12.2. Configuring the Unified Logging Service

Working with Portal Usage Reporting

Portal usage reporting is a service that logs statistics about site activity in a SharePoint farm. Before you start the service, you should recognize that gathering usage information can have a negative impact on the performance of the farm. If you do enable usage logging, be sure to schedule the log processing outside of normal business hours. In order to use the service, it must first be enabled in the Central Administration site. For a MOSS installation, you must also configure processing in the Shared Services Provider.

Follow these steps to configure usage reporting in MOSS:

  1. Log in to VSMOSS as a farm administrator.

  2. Select Start

    Working with Portal Usage Reporting
  3. When the Central Administration site opens, click the Operations tab.

  4. Under the Logging and Reporting section, click the link titled Usage Analysis Processing.

  5. On the Usage Analysis Processing page, check the box labeled Enable Logging.

  6. Check the box labeled Enable Usage Analysis Processing.

  7. Click the OK button.

  8. In the Central Administration site, click the link in the Quick Launch area to open the Shared Services Administration site.

  9. On the home page of the Shared Services Administration site, click the Usage Reporting link.

  10. On the Configure Advanced Usage Analysis Processing page, check the box labeled Enable Advanced Usage Analysis Processing.

  11. Click the OK button.

  12. Open the home page of the intranet site you created in Chapter 2 (e. g., http://vsmoss/sites/intranet/pages/default.aspx).

  13. On the home page, select Site Settings

    Working with Portal Usage Reporting
  14. On the Site Settings page, click the link titled Site Collection Usage Reports.

After you enable usage processing, it may take several minutes before you can view the usage page in a site collection. Additionally, no usage data will initially be available because the data is created when the scheduled usage processing job runs. Figure 12-3 shows a usage report for the intranet site collection shortly after setting up the service.

Viewing usage data

Figure 12.3. Viewing usage data

Working with Information Management Policy Usage Reports

In Chapter 6, I discussed information policies and how to apply them to documents within SharePoint. Once policies are in place, you can set up to generate reports that show how many items are using each policy across the farm. These reports are generated as Excel spreadsheets with a pivot table, a description of each active policy, and a list of sites where the policy is in use. Regular policy reporting is designed to help organizations evaluate the effectiveness of the active policies.

Follow these steps to set up policy usage reporting:

  1. Open the home page of the intranet site you created in Chapter 2 (e. g., http://vsmoss/sites/intranet/pages/default.aspx).

  2. Click the Reports tab to open the Report Center.

  3. Click the link titled View All Site Content in the Quick Launch area.

  4. On the All Site Content page, click the Create link.

  5. On the Create page, click the Document Library link.

  6. On the New page, enter Policy Usage Reports in the Name field.

  7. Select Microsoft Office Excel spreadsheet from the Document Template drop-down list.

  8. Click the Create button.

  9. Select Start

    Working with Information Management Policy Usage Reports
  10. When the Central Administration site opens, click the Operations tab.

  11. Under the Logging and Reporting section, click the link titled Information Management Policy Usage Reports.

  12. On the Information Management Policy Usage Reports page, click the Web Application drop-down and select Change Web Application.

  13. In the Select Web Application dialog, select the Intranet web application.

  14. On the Information Management Policy Usage Reports page, check the box labeled Enable Recurring Policy Usage Reports.

  15. Enter /Reports/Policy%20/Usage%20/Reports in the Report File Location field.

  16. Click the Check URL button to verify the entered location refers to the document library you created earlier.

  17. Click the Create Reports Now button.

  18. Click the OK button. A new report should be generated in the document library you created earlier.

Configuring Caching Options

MOSS supports several caching options that can be used to improve the performance of sites in the farm. The caching options in MOSS are built on top of the ASP.NET 2.0 caching options with some additional functionality. Caching in SharePoint can be set up for site pages and binary large objects (BLOB) such as image files. Complete pages are cached using the output cache while individual items are cached using the object cache.

Caching elements of a SharePoint site collection can result in significant performance increases. Once an element is rendered, SharePoint does not have to make additional round-trips to the database for content or reload web parts into memory until the cached elements time-out. Because of the decreased load, caching helps the farm scale easier as well.

Caching is not without drawbacks, however. Caching uses additional memory for storing the cached elements. In a web farm, caching can also lead to discrepancies in the viewed content. If different versions of a page are cached on each web front end, and the load balancer is set up to send client requests to any available server, it would be possible for a user to see different versions of a page with each postback. If caching is implemented properly, such issues are unlikely to cause major problems so you should consider caching a net positive overall.

Understanding Cache Profiles

One of the improvements MOSS makes over ASP.NET 2.0 caching is the implementation of cache profiles. A cache profile is a group of cache settings that you can create and then specifically use with output caching. Using cache profiles, you can control the degree of caching and tune the performance of the farm.

Cache profiles are generally created for a specific zone. Because a group of users in a given zone will see the same elements, it makes sense to group cache profiles in this way. Out of the box, SharePoint defines profiles for the zones you create within a web application, but you can customize them or create your own. Before you enable output caching, you should configure the cache profiles.

Follow these steps to configure cache profiles:

  1. Open the home page of the intranet site you created in Chapter 2 (e. g., http://vsmoss/sites/intranet/pages/default.aspx).

  2. On the home page, select Site Settings

    Understanding Cache Profiles
  3. On the Site Settings page, click the link titled Site Collection Cache Profiles.

  4. In the Cache Profiles list, click on the Intranet (Collaboration Site) link. Figure 12-4 shows the Intranet cache profile.

Viewing cache profiles

Figure 12.4. Viewing cache profiles

The fields in the cache profile represent different settings that are applied to the output cache of a site collection or site. You can change any of these settings or create a new profile with unique settings. Table 12-1 lists all of the available settings and describes their functions.

Table 12.1. Cache Profile Settings

Setting

Values

Description

Allow Writers to View Cached Content

Check/Uncheck

When enabled, content authors will have their pages cached even if they are in draft form.

Cacheability

NoCache, Private, Public, Server, ServerAndNoCache, ServerAndPrivate

NoCache denies caching; Private caches on the web client; Public caches on the client, proxy server, and web server; Server caches on the server; ServerAndNoCache caches on the server and specifically denies client caching; ServerAndPrivate caches at the client and server.

Check for Changes

Check/Uncheck

When enabled, this checks for changes to the content and flushes the cache if the associated site content has changed.

Duration

Number

This sets the number of seconds to keep output cached before it expires.

Enabled

Check/Uncheck

This turns on caching for this profile.

Perform ACL Check

Check/Uncheck

When enabled, this setting ensures that all content in the output cache is security trimmed. When disabled, performance is better, but no security trimming occurs. Therefore, this option should only be disabled when security trimming is not required.

Safe for Authenticated Use

Check/Uncheck

This setting marks the policy as safe for use by authenticated users.

Vary by Custom Parameter

Text

This setting specifies a string that represents a header by which to vary the output cache. For example, setting this to Accept-Charset varies the output for each browser's character set.

Vary by HTTP Header

Text

This setting specifies a list of HTTP headers by which to vary the output cache. Requests with these headers will receive the same output.

Vary by Query String Parameters

Text

This setting specifies a list of QueryString parameters by which to vary the output cache. Requests with the same parameters will receive the same output.

Vary by Rights

Check/Uncheck

When enabled, this provides the same cached output to users with identical rights.

Configuring Output Caching

Once you are satisfied with the cache profiles, you can enable output caching. Output caching may be managed at the site collection, and all sites within the collection will inherit these settings. When you enable output caching, you must specify the profiles to use for both authenticated and anonymous users.

Follow these steps to enable caching:

  1. Open the home page of the intranet site you created in Chapter 2 (e. g., http://vsmoss/sites/intranet/pages/default.aspx).

  2. On the home page, select Site Settings

    Configuring Output Caching
  3. On the Site Settings page, click the link titled Site Collection Output Cache.

  4. On the Site Collection Output Cache page, check the box labeled Enable Output Cache.

  5. In the Authenticated Cache Profile, select Intranet (Collaboration Site) from the drop-down list.

  6. Click the OK button.

  7. On the Site Settings page, click the link titled Site Output Cache.

  8. On the Site Output Cache page, verify that the site is inheriting its settings from the site collection.

  9. Click the OK button.

Configuring Object and Disk Caching

Object caching is a mechanism used by SharePoint to cache site, page, and page layout properties. Disk caching is used to cache BLOBs so that they do not have to be retrieved from the database. Object and disk caching are extremely fast and can significantly improve performance of sites, especially when large media files are involved. By default, object caching is always on, and disk caching is turned off. In order to enable disk caching, you must edit the web.config file for the web application where you want to use it. The BlobCache element controls disk caching and is shown in the following code:

<BlobCache location="C:lobCache" path=".(gif|jpg|png|css|js)$"
           maxSize="10" max-age="86400" enabled="false"/>

Changing the value of the enabled attribute to True will enable disk caching. The attributes associated with the BlobCache element control the configuration of the object cache. These are set to generally acceptable values, but may be changed. Table 12-2 lists the attributes and their effects on the object cache.

Table 12.2. The BlobCache Elements

Attribute

Description

location

The directory where the cached files will be stored

path

A regular expression that matches file extensions to determine which files are cached

maxSize

The maximum size of the disk-based cache in gigabytes

max-age

The amount of time in seconds that the client browser caches BLOBs

enabled

A value to enable or disable the object cache

You can manage the object and disk cache through SharePoint. Each site collection has access to cache management through the Site Settings page. On the Site Settings page, you can click the link titled Site Collection Object Cache to access a page that will let you change the maximum size, flush a cache, or change attributes. Figure 12-5 shows the page.

Managing the object and disk caches

Figure 12.5. Managing the object and disk caches

Using Windows Rights Management

Windows Rights Management Services (RMS) is a technology that allows you to control granular permissions associated with documents. RMS is an enhancement to typical file-level permissions and allows you to control who can view, edit, copy, print, or e-mail your documents. RMS is useful for ensuring that highly sensitive documents are not printed, copied, or mailed outside of the organization.

Document restrictions can be put in place either by an author or by policy on a document library. Document authors can implement restrictions by selecting Prepare

Using Windows Rights Management
Restricting document permissions

Figure 12.6. Restricting document permissions

RMS does not explicitly require SharePoint 2007. You can set up RMS and use it to secure Office documents without ever storing those documents in SharePoint. However, if you want to use RMS in conjunction with SharePoint, you can configure your farm to allow RMS security to work with document libraries. In this section, I'll show you how to set up and configure RMS for use with SharePoint.

Preparing for RMS Installation

Before you begin the installation process, you must download the RMS server and client. RMS works by establishing a centralized server that verifies permissions when a document is opened. Each person wishing to use RMS documents must have the RMS client installed on their machine as well. Additionally, the SharePoint server requires the RMS client to be installed so that document libraries can be configured to support RMS. Table 12-3 lists the required software and the location from which it can be downloaded.

Table 12.3. Required Software

Software

Location

RMS server

http://www.microsoft.com/downloads/details.aspx?FamilyId=5794538F-E572-4542-A5BD-901B2720F068&displaylang=en

RMS client

http://www.microsoft.com/downloads/details.aspx?FamilyId=02DA5107-2919-414B-A5A3-3102C7447838&displaylang=en

After you have downloaded the required software, you can prepare the server for RMS installation. In this example, I will use the VSSQL server from the development environment to host the RMS server. The server running RMS must be an application server with Message Queuing and .NET Framework 1.1 installed.

Follow these steps to prepare for RMS installation:

  1. Log in to VSSQL as a domain administrator.

  2. Select Start

    Required Software
  3. In the Add or Remove Programs dialog, click the Add/Remove Windows Components button.

  4. In the Windows Components Wizard, select Application Server and click the Details button.

  5. In the Application Server dialog, check the box associated with Message Queuing and click the OK button.

  6. In the Windows Components Wizard, click the Next button.

  7. When Message Queuing installation is complete, close the Add/Remove Programs dialog.

  8. Select Start

    Required Software
  9. In the IIS Manager, expand the tree until the Web Service Extensions folder is visible.

  10. If ASP.NET v1.1.4322 is not visible, click the link titled Add a New Web Service Extension.

  11. In the New Web Service Extension dialog, click the Add button.

  12. In the Add File dialog, click the Browse button.

  13. Browse to the file located at C:Windows Microsoft .NETFrameworkv1.1.4322aspnet_isapi.dll and click the Open button.

  14. In the Add File dialog, click the OK button.

  15. In the New Web Service Extension dialog, enter ASP.NET v1.1.4322 in the Extension Name field.

  16. Check the box labeled Set Extension Status to Allowed.

  17. Click the OK button.

Installing the RMS Server

The RMS server software installation is straightforward, but you must perform a few configuration steps after the installation. Specifically, you must provision the RMS server on to an IIS web site and register RMS in Active Directory so that client machines can find it.

Follow these steps to install and configure the RMS server:

  1. Launch the Windows Rights Management server installation and follow the steps.

  2. When the installation is complete, select Start

    Installing the RMS Server
  3. In the Windows RMS Global Administration site, click the link titled Provision RMS on this Web Site.

  4. On the Provision the RMS Root Certification Server page, select the Remote Database option under the Configuration Database section.

  5. Under the RMS Service Account section, enter DOMAINSPConfigAcct in the User Name field.

  6. Enter the appropriate password in the Password field.

  7. Under the Private Key Protection and Enrollment section, enter a strong password in the RMS Private Key Password field.

  8. Enter a contact name in the Administrative Contact field.

  9. Under the RMS Proxy Settings section, clear the box labeled This Computer Uses a Proxy Server to Connect to the Internet.

  10. Click the Submit button.

  11. When provisioning is complete, select Start

    Installing the RMS Server
  12. In the Windows RMS Global Administration site, click the link titled Administer RMS on This Web Site.

  13. On the Administration for Default Web Site page, click the link titled RMS Service Connection Point.

  14. On the RMS Service Connection Point page, click the Register URL button.

  15. Open the Windows File Explorer and navigate to the file C:InetpubwwwrootWRM\_wmcsCertificationServerCertification.asmx.

  16. Right-click the ServerCertification.asmx file and select Properties from the context menu.

  17. Click the Security tab.

  18. On the Security tab, click the Add button.

  19. In the Select Users, Computers, or Groups dialog, type Authenticated Users and click the Check Names button. This step is required so that the Central Administration web site can utilize the RMS client when configuring RMS for the SharePoint farm.

  20. Click the OK button.

  21. In the ServerCertification.asmx Properties dialog, click the OK button.

Configuring RMS in the SharePoint Farm

Once the RMS server is installed, you may set up RMS for SharePoint. SharePoint uses the Central Administration web site to enable the use of RMS on document libraries in the farm. In order to work with RMS, the RMS client must be installed on the SharePoint server before configuring the farm.

Follow these steps to configure RMS for the SharePoint farm:

  1. Log in to VSMOSS as a domain administrator.

  2. Launch the Windows Rights Management client installation and follow the steps.

  3. When the installation is complete, select Start

    Configuring RMS in the SharePoint Farm
  4. When the Central Administration site opens, click the Operations tab.

  5. Under the Security Configuration section, click the link titled Information Rights Management.

  6. On the Information Rights Management page, click the option labeled Use the Default RMS Server Specified in Active Directory.

  7. Click the OK button.

  8. Open the home page of the intranet site you created in Chapter 2 (e. g., http://vsmoss/sites/intranet/pages/default.aspx).

  9. Click the Document Center tab.

  10. In the Document Center, click the Documents library.

  11. In the Documents library, select Settings

    Configuring RMS in the SharePoint Farm
  12. On the Customize page, click the link titled Information Rights Management.

  13. Check the box labeled Restrict Permission to Documents in This Library on Download.

  14. Enter Restricted in the Permission Policy Title field.

  15. Enter Secured documents in the Permission Policy Description field.

  16. Click the OK button.

Using RMS with Documents

Once RMS is configured on the farm and you have established a policy for a document library, you can test it from a client machine. Each client must have the RMS client software installed before they can access protected documents. Once installed, clients may use RMS to protect their own documents as well as work with documents protected by SharePoint.

Follow these steps to use RMS from a client:

  1. Log in to VSCLIENT as a local administrator.

  2. Launch the Windows Rights Management client installation and follow the steps.

  3. Open the home page of the intranet site you created in Chapter 2 as someone other than the author of documents in the library.

  4. Click the Document Center tab.

  5. In the Document Center, click the Documents library and open a document from the library.

  6. Verify that the Print button is disabled in Word. Figure 12-7 shows the menu in Word 2007 with the Print command disabled.

The File menu in Word 2007

Figure 12.7. The File menu in Word 2007

Configuring Antivirus Protection

SharePoint 2007 supports antivirus scanning of documents when they are uploaded into a document library or opened by a user. In order to perform the scanning, however, you must purchase a commercial antivirus program and install it on each front-end web server in the farm. Most of the big-name vendors have product offerings specifically for SharePoint. Once installed, you may configure antivirus support by clicking the Antivirus link on the Operations page. Figure 12-8 shows the Anitvirus page in the Central Administration site.

Configuring antivirus support

Figure 12.8. Configuring antivirus support

Quiescing the Farm

SharePoint 2007 introduces a new word into the technical lexicon to describe taking a farm out of service. Quiesce is defined as the act of going to rest. Interestingly, this word is not even present in the references contained within the Word 2007 Research pane, but you will see it on the Operations tab under the Global Configuration section.

When you quiesce a farm, you cause it to shut down slowly so that it can finish processing pending requests. Although the farm will immediately stop accepting new requests, it will try to complete all existing requests so that users do not experience a sudden service interruption. This is in stark contrast to a simple IIS reset, which will simply drop all requests. When you quiesce the farm, you specify a duration over which to complete the operation. While the farm is quiescing, it will continue to process any pending requests. If the specified duration is exceeded, these requests will subsequently be dropped. Figure 12-9 shows the options for quiescing the farm.

Quiescing the farm

Figure 12.9. Quiescing the farm

Cleaning Up Unused Sites

If your SharePoint infrastructure is successful, you may find that you have a proliferation of team and departmental sites. The problem with site proliferation is that there is really no motivation for any user to delete a site after it has served its purpose. If a user creates a site for the annual company sales meeting, for example, he or she is unlikely to care about the site after the meeting is over. This can lead to many dead sites in the farm.

The solution in SharePoint is to implement site-use confirmation and deletion. This facility allows SharePoint to query site owners and determine whether a site is still in use. The owners confirm sites that are still in use, whereas sites that are no longer useful may be deleted. If you want, you can even set up SharePoint to automatically delete sites that have not been confirmed over a period of time.

Site use and confirmation is configured to send e-mail notifications to the owner of a site collection that has not been used for a specified period of time. When the e-mail is received, the owner will have a set of hyperlinks in the e-mail that will allow the owner to confirm that the site is in use or delete the site. If you have enabled automatic site deletion, the site will automatically be deleted if the site collection owner fails to respond to the request after a configured number of notifications. Figure 12-10 shows the configuration page, which is accessible from the Application Management tab in the Central Administration site.

Enabling automatic site deletion ensures that unneeded sites are always removed from the farm. However, automatically deleting sites can result in the removal of sites that are seldom used but contain valuable information. For this reason, you should always set reasonable notification intervals that give plenty of opportunity for site collection owners to respond. Finally, you should require that all site collections have a designated secondary owner who can respond to the notifications if the primary owner is unavailable.

Configuring site-use confirmation and deletion

Figure 12.10. Configuring site-use confirmation and deletion

The site use confirmation and deletion system uses two different message texts to send notifications: one text is used when you enable site confirmation, while the other text is used if you have also enabled automatic deletion. Administrators may customize these notices, which are located in C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12TEMPLATE1033XMLDeadWeb.xml. Listing 12-1 shows the contents of the notification file.

Example 12.1. The Site Notification Message

<?xml version="1.0" encoding="utf-8"?>
<!-- _lcid="1033" _version="12.0.4518" _dal="1" -->
<!-- _LocalBinding -->
<Email>
  <Confirmation>
    <ConfirmationSubject>
      Confirm SharePoint Web site in use
    </ConfirmationSubject>
    <ConfirmationBody>
      <![CDATA[Please follow the link below
      to your SharePoint Web site to confirm that it is still in use.
      <br><a href="|0">|0</a><br><br>
      If the site is not being used, please go to <a href="|1">|1</a>,
      and select "Delete This Site" to remove the Web site.
      <br><br>
You will receive reminders of this until you confirm the
      site is in use, or delete it.]]>
    </ConfirmationBody>
  </Confirmation>
  <AutoDeleteWarning>
    <AutoDeleteSubject>
      ACTION REQUIRED: Your SharePoint site collection is about to expire
    </AutoDeleteSubject>
    <AutoDeleteBody>
      <![CDATA[To extend the expiration date for this site
      collection, click the link below:<br><a href="|0">|0</a><br><br>
      Otherwise this site collection, including all of its subsites,
      might be deleted.<br><br>
      If this site collection is no longer needed, you can
      delete it by going to <a href="|1">|1</a>, and selecting
      "Delete this site".<br><br>
      Please note - When a SharePoint Web site collection is
      deleted, all Web sites, content and information which
      were part of the site collection are completely erased.
      The site can only be restored if a backup exists.]]>
    </AutoDeleteBody>
  </AutoDeleteWarning>
</Email>

Implementing Quotas and Locks

When you create SharePoint sites, there is really no limit to the amount of information that users may store there. In some cases, this can lead to very large sites that take up a significant amount of storage space. If you would like to limit the size of sites, you can implement a quota template that defines the storage limits.

Quota templates are created by clicking the link found on the Application Management page. Quota templates define a maximum allowed storage limit and a point at which a warning e-mail should be sent to the site administrator. When you open the Quota Templates page, you'll see that SharePoint has defined some templates for you, but you can easily create your own.

Quota templates are applied to sites by clicking the link titled Site Collection Quotas and Locks on the Application Management tab. On this page, you may select the site collection to which you want to apply a quota. Then you may select the quota template to implement.

Along with specifying a quota, you may also use this page to lock a site collection. Locking a site collection allows you to specify various levels of access to a site collection while preserving the existing data. This is an excellent way to archive a site collection that is not in use but has valuable information within it. Figure 12-11 shows the Site Collection Quota and Locks page.

Manging quotas and locks

Figure 12.11. Manging quotas and locks

Using the Command-Line Utility

This chapter has covered several key administrative tasks that you can perform through the Central Administration web site. However, you can perform these tasks and many others through the command-line utility STSADM.EXE, which is located in the folder C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12in. I have mentioned STSADM.EXE in previous chapters for such things as installing features, but this utility is capable of performing a wide variety of tasks. Typically, you'll use the -o parameter to specify the operation to perform followed by a series of values to use with the operation. The following code shows an example operation that installs the NewButton feature.

STSADM.EXE -o installfeature -filename NewButtonFeature.xml

STSADM.EXE supports a few dozen operations. Executing STSADM.EXE -help will list all of the possible operations you can perform with the utility. Executing the help command followed by the name of an operation will display the proper format for the operation and the required parameters.

Exercise 12.1. Creating a Log Viewer Feature

Earlier in this chapter, I discussed the Unified Logging Service (ULS) and how SharePoint uses it to record key events and exceptions. I also noted that there is no utility available for easily viewing these logs. In this exercise, you will create a feature for the Central Administration web site that will allow you to view and filter the ULS logs.

Follow these steps to get started with the project:

  1. Log in to VSMOSS as a SharePoint administrator.

  2. Select Start

    Exercise 12.1. Creating a Log Viewer Feature
  3. When Visual Studio starts, select File

    Exercise 12.1. Creating a Log Viewer Feature
  4. In the New Project dialog, click the C# node in the Project Types tree.

  5. Select the Class Library project from the Templates list.

  6. Enter LogViewer in the Name field and click the OK button.

  7. When the new project is created, right-click the Class1.cs file in the Solution Explorer and select Delete from the context menu. You will not need a class module for this project.

Creating the ULSLogViewer Page

The heart of this project is the ULSLogViewer.aspx page. This page will be deployed so that it becomes part of the Central Administration web site. The goal is to create a page that fits in with the site and looks like it was part of the original product. In order to make this happen, you will create the ASPX page as a single file and deploy it into the folder C:Program FilesCommon Filesweb server extensions12TEMPLATEADMIN folder. This folder is similar to the LAYOUTS folder you used when you created features for site collections. Pages placed in the ADMIN folder can use the admin.master file, which defines the look and feel for the Central Administration web site.

Follow these steps to create the ULSLogViewer.aspx page:

  1. In Visual Studio, select Project

    Creating the ULSLogViewer Page
  2. In the Add New Item dialog, select to add a text file to the project. You must select a text file because web forms are not available to this project type.

  3. Enter ULSLogViewer.aspx in the Name field.

  4. Click the OK button.

Adding Required References

Once the new blank page is open in Visual Studio, you must begin the process of coding the page. Creating a page that can successfully run inside the Central Administration web site requires careful attention to detail. Although you will have IntelliSense available, you do not have a visual development environment or access to all of the project elements such as the admin.master. Therefore, you may see some errors during design that will not impact the page when it is properly deployed. In any case, you must start by adding the appropriate references to the admin.master page, the control templates, and the required assemblies. Add the code from Listing 12-2 to the page to add these references.

Example 12.2. Required References

<%@ Page Language="C#" MasterPageFile="~/_admin/admin.master" %>

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0,
    Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages.Administration,
    Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="System.Web, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.Administration" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Data" %>
<%@ Register TagPrefix="SharePoint"
    Namespace="Microsoft.SharePoint.WebControls" %>
<%@ Register TagPrefix="Utilities"
    Namespace="Microsoft.SharePoint.Utilities"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0,
    Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection"
    Src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl"
    Src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection"
    Src="~/_controltemplates/ButtonSection.ascx" %>

Coding Placeholders

Once you have the required references at the top of the page, you may begin to add content to the placeholders. The available placeholders are defined by the admin.master page and include placeholders for the page title and description. Add the code from Listing 12-3 to define these content placeholders.

Example 12.3. Placeholders Code

<asp:Content ID="Content2" runat="server"
     ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea">
     Unified Logging Service (ULS) Logs
</asp:Content>
<asp:Content ID="Content3" runat="server"
     ContentPlaceHolderID="PlaceHolderPageDescription">
    This page allows you to browse the Unified Logging Service logs
</asp:Content>

Coding the Main Placeholder

The most complicated part of the page is the code for the main placeholder. The main placeholder represents the body of the page. Here you will define drop-down lists to select the log file for viewing as well as parameters for filtering the logs. The layout of this page is controlled by the user controls InputFormSection and InputFormControl. These user controls were created specifically for the Central Administration site and give it that familiar two-column look with explanations on the left and controls on the right. There is some effort involved in working through this code, but it is an excellent way to learn how a SharePoint page is laid out. Add the code from Listing 12-4 to create the main body of the page.

Example 12.4. The Main Placeholder Code

<asp:Content ID="Content4" runat="server"
     ContentPlaceHolderID="PlaceHolderMain">
  <table border="0" cellspacing="0" cellpadding="0"
  class="ms-propertysheet" width="100%">
    <tr><td>
      <!-- This section lists the log files that are on the server -->
      <wssuc:InputFormSection Title="Available log files" runat="server">
        <template_description>
          <asp:Literal Id="Literal1" runat="server"
          text="These are the available log files that you can view."/>
        </template_description>
        <template_inputformcontrols>
          <wssuc:InputFormControl runat="server"
          LabelText="Select a log file to view">
            <Template_control>
              <asp:DropDownList ID="listFiles" runat="server"
              EnableViewState="true" Width="100%"/>
            </Template_control>
          </wssuc:InputFormControl>
        </template_inputformcontrols>
      </wssuc:InputFormSection>

      <!-- This section filters the logs by category and severity -->
      <wssuc:InputFormSection Title="Log Filtering" runat="server">
        <template_description>
          <asp:Literal runat="server"
          text="Select the keywords to use when filtering the logs"/>
        </template_description>
        <template_inputformcontrols>
<TABLE border="0" cellspacing="0" cellpadding="0" width="100%">
            <tr><td>
              <wssuc:InputFormControl runat="server"
              LabelText="This category..."
              LabelAssociatedControlId="listCategories">
              <Template_control>
                <asp:DropDownList Id="listCategories" runat="server"
                EnableViewState="true">
                  <asp:ListItem value="empty" Text=""/>
                  <asp:ListItem value="Administration" Text="Administration"/>
                  <asp:ListItem value="Backup and Restore"
                  Text="Backup and Restore"/>
                  <asp:ListItem value="Backward Compatible"
                  Text="Backward Compatible Administration and Object Model"/>
                  <asp:ListItem value="Business Data"
                  Text="Business Data Catalog"/>
                  <asp:ListItem value="Communication" Text="Communication"/>
                  <asp:ListItem value="Content Deployment"
                  Text="Content Deployment"/>
                  <asp:ListItem value="Database" Text="Database"/>
                  <asp:ListItem value="Document Management"
                  Text="Document Management"/>
                  <asp:ListItem value="E-Mail" Text="E-Mail" />
                  <asp:ListItem value="Excel" Text="Excel Services"/>
                  <asp:ListItem value="Feature Infrastructure"
                  Text="Feature Infrastructure"/>
                  <asp:ListItem value="Fields" Text="Fields"/>
                  <asp:ListItem value="Forms Services" Text="Forms Services"/>
                  <asp:ListItem value="General" Text="General"/>
                  <asp:ListItem value="Information Policy Management"
                  Text="Information Policy Management"/>
                  <asp:ListItem value="IRM"
                  Text="Information Rights Management"/>
                  <asp:ListItem value="Knowledge Network Server"
                  Text="Knowledge Network Server"/>
                  <asp:ListItem value="Launcher Service"
                  Text="Launcher Service"/>
                  <asp:ListItem value="Load Balancer Service"
                  Text="Load Balancer Service"/>
                  <asp:ListItem value="Long running operation infrastructure"
                  Text="Long running operation infrastructure"/>
                  <asp:ListItem value="MCMS 2002 Migration"
                  Text="MCMS 2002 Migration"/>
                  <asp:ListItem value="Office Server" Text="MOSS General"/>
                  <asp:ListItem value="Shared Services"
                  Text="MOSS Shared Services"/>
<asp:ListItem value="MS Search" Text="MS Search"/>
                  <asp:ListItem value="Project Server" Text="Project Server"/>
                  <asp:ListItem value="Publishing" Text="Publishing Features"/>
                  <asp:ListItem value="Records Center" Text="Records Center"/>
                  <asp:ListItem value="Runtime" Text="Runtime"/>
                  <asp:ListItem value="Server Help" Text="Server Help"/>
                  <asp:ListItem value="Session State Service"
                  Text="Session State Service"/>
                  <asp:ListItem value="Setup and Upgrade"
                  Text="Setup and Upgrade"/>
                  <asp:ListItem value="SharePoint Services"
                  Text="SharePoint Services"/>
                  <asp:ListItem value="Site Directory" Text="Site Directory"/>
                  <asp:ListItem value="Site Management" Text="Site Management"/>
                  <asp:ListItem value="SSO" Text="SSO"/>
                  <asp:ListItem value="Timer" Text="Timer"/>
                  <asp:ListItem value="Topology" Text="Topology"/>
                  <asp:ListItem value="Unified Logging Service"
                  Text="Unified Logging Service"/>
                  <asp:ListItem value="Upgrade" Text="Upgrade"/>
                  <asp:ListItem value="User Profiles" Text="User Profiles"/>
                  <asp:ListItem value="Web Controls" Text="Web Controls"/>
                  <asp:ListItem value="Web Parts" Text="Web Parts"/>
                  <asp:ListItem value="WebParts" Text="WebParts"/>
                  <asp:ListItem value="Workflow" Text="Workflow"/>
                </asp:DropDownList>
              </Template_control>
            </wssuc:InputFormControl>
          </td></tr>
          <tr><td>
<wssuc:InputFormControl runat="server"
            LabelText="AND this event severity..."
            LabelAssociatedControlId="listEvent" >
              <Template_control>
                <asp:DropDownList id="listEvent" runat="server"
                  EnableViewState="true">
                  <asp:ListItem Value="empty" Text=""/>
                  <asp:ListItem Value="Error" Text="Error"/>
                  <asp:ListItem Value="Warning" Text="Warning"/>
                  <asp:ListItem Value="Failure" Text="Failure"/>
                  <asp:ListItem Value="Critical" Text="Critical"/>
                  <asp:ListItem Value="Success" Text="Success"/>
                  <asp:ListItem Value="Information" Text="Information"/>
                </asp:DropDownList>
              </Template_control>
            </wssuc:InputFormControl>
          </td></tr>
          <tr><td>
            <wssuc:InputFormControl runat="server"
            LabelText="OR this trace severity"
            LabelAssociatedControlId="listTrace" >
              <Template_control>
                <asp:DropDownList id="listTrace" runat="server"
                EnableViewState="true">
                  <asp:ListItem Value="empty" Text=""/>
                  <asp:ListItem Value="Unexpected" Text="Unexpected"/>
                  <asp:ListItem Value="Monitorable" Text="Monitorable"/>
                  <asp:ListItem Value="High" Text="High"/>
                  <asp:ListItem Value="Medium" Text="Medium"/>
                  <asp:ListItem Value="Verbose" Text="Verbose"/>
                </asp:DropDownList>
              </Template_control>
            </wssuc:InputFormControl>
          </td></tr>
        </TABLE>
      </template_inputformcontrols>
    </wssuc:InputFormSection>
    <!-- This section contains a button to show the logs -->
    <wssuc:InputFormSection Title="Show the log" runat="server">
      <template_description>
        <asp:Literal Id="Literal3" runat="server"
        text="Press the button to view the selected log."/><br />
          <asp:Literal Id="Literal2" runat="server"
          text="Note: Logs can take some time to process and display."/>
            </template_description>
              <template_inputformcontrols>
                <wssuc:InputFormControl runat="server" LabelText="">
                  <Template_control>
                    <asp:Button Id="buttonGo" Text="Go" Width="60px"
                    runat="server" onclick="FillGrid"/>
                  </Template_control>
                </wssuc:InputFormControl>
              </template_inputformcontrols>
            </wssuc:InputFormSection>
          </td></tr>
        </table>
      <!-- This table shows the selected log entries -->
      <table border="0" cellspacing="0" cellpadding="0"
      class="ms-propertysheet" width="100%">
<tr><td>
          <asp:Label runat="server" ID="message" class="ms-error" />
        </td></tr>
        <tr><td>
          asp:DataGrid runat="server" ID="gridLog" Width="100%"
          class="ms-descriptionText" GridLines="Horizontal" />
        </td></tr>
    </table>
</asp:Content>

Adding Required Script

The last part of the page involves writing the code to parse the logs and display them in a grid. This code is reasonably straightforward. It simply opens the selected log file, separates it into columns, and loads a custom DataTable with the information. The DataTable is then bound to a DataGrid for display. Add the code from Listing 12-5 to finish the page.

Note

Be sure the connection string in the following code is correct for your environment.

Example 12.5. Processing the Logs

<script runat="server">


  protected void Page_Load(object sender, EventArgs e)
  {

    if (!Page.IsPostBack)
    {
      try
      {
        //Open the farm
        SPFarm farm = SPFarm.Open
        ("Data Source=VSSQL;Initial Catalog=MOSS_Config;
Processing the Logs
Integrated Security=SSPI"); //Get reference to ULS SPDiagnosticsService diagnostics = new SPDiagnosticsService("log", farm); string[] files = Directory.GetFiles(diagnostics.LogLocation,"*.log"); //Show list of logs DataTable lines = new DataTable("Lines"); lines.Columns.Add("Name", typeof(string)); lines.Columns.Add("Path", typeof(string));
for (int i = files.Length - 1; i>1; i--)
       {
         if (files[i].IndexOf("Diagnostics") == 1)
         {
           string[] line = { files[i].Substring(files[i].LastIndexOf("\") + 1),
           files[i] };
           lines.Rows.Add(line);
         }
       }

       listFiles.DataSource = lines;
       listFiles.DataTextField = "Name";
       listFiles.DataValueField = "Path";
       listFiles.DataBind();
       listFiles.Items.Insert(0, "Select a file...");


     }
     catch (Exception x)
     {
       message.Text = x.Message;
     }
   }
  }

  protected void FillGrid(object sender, EventArgs e)
  {

    try
    {
      message.Text = "";

      //Create table
      DataTable entries = new DataTable("Entries");
      entries.Columns.Add("Timestamp", typeof(string));
      entries.Columns.Add("Process", typeof(string));
      entries.Columns.Add("TID", typeof(string));
      entries.Columns.Add("Area", typeof(string));
      entries.Columns.Add("Category", typeof(string));
      entries.Columns.Add("EventID", typeof(string));
      entries.Columns.Add("Level", typeof(string));
      entries.Columns.Add("Message", typeof(string));
      entries.Columns.Add("Correlation", typeof(string));
//Fill table
      StreamReader reader = new StreamReader(listFiles.SelectedValue);
      reader.ReadLine().Split(new char[] { '	' });

      while (!reader.EndOfStream)
      {
        string[] fields = reader.ReadLine().Split(new char[] { '	' });

       //Category selected
        if(listCategories.Text != "empty")
        {
          //Category and Level selected
          if(listEvent.Text != "empty" || listTrace.Text != "empty")
          {
            if(fields[4].IndexOf(listCategories.Text) >= 0
               &&
               (fields[6].IndexOf(listEvent.Text) >= 0
               ||
               fields[6].IndexOf(listTrace.Text) >= 0))
               {
                 entries.Rows.Add(fields);
                }

                }
                //Category, but no Level selected
                else
                {
                if(fields[4].IndexOf(listCategories.Text) >= 0)
                {
                  entries.Rows.Add(fields);
                }
              }
            }

            //Category not selected
            else
            {
              //Level selected
              if(listEvent.Text != "empty" || listTrace.Text != "empty")
              {
                if(fields[6].IndexOf(listEvent.Text) >= 0
                   ||
                   fields[6].IndexOf(listTrace.Text) >= 0)
                   {
                     entries.Rows.Add(fields);
                   }
                  }
//Nothing selected
                  else
                  {
                    entries.Rows.Add(fields);
                  }
              }
          }

         //Show in grid
         gridLog.DataSource = entries;
         gridLog.DataBind();
      }

      catch (Exception x)
      {
          message.Text = x.Message;
      }
  }

</script>

Creating the Feature File

Once the log viewing page is written, you must create a feature to add a new section to the Central Administration site that contains a link to the new page. This feature will be created just as you created other features in Chapter 7. First, you must create a Feature.xml file, then you must create a manifest file to implement the new link. Add a new XML file named Feature.xml to your project and add the code from Listing 12-6.

Example 12.6. The Feature File

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns=http://schemas.microsoft.com/sharepoint/
  Id="7B636574-FF78-4103-9791-879614CF6D1D"
  Scope="Farm"
  Title="Unified Logging Service (ULS) viewer"
  Description="Allows you to view ULS logs">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />
  </ElementManifests>
</Feature>

Creating the Manifest File

The manifest file describes the new section and link to be added to the Central Administration web site. The new section is created through a CustomActionGroup element. The link is created with a CustomAction element. Add a new XML file named Elements.xml to your project and add the code from Listing 12-7.

Example 12.7. The Manifest File

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomActionGroup Id="BDDBB947-CBC6-47f7-B57A-6C8BEB0E19D7"
    Location="Microsoft.SharePoint.Administration.Operations"
    Title="Utilities"
    Sequence="1000" />
  <CustomAction
    Id="E57ECD33-91FD-4fc3-A4E8-E1B932178CB4"
    GroupId="BDDBB947-CBC6-47f7-B57A-6C8BEB0E19D7"
    Location="Microsoft.SharePoint.Administration.Operations"
    Sequence="10"
    Title="View Unified Logging Service"
    Description="Displays Unified Logging Service (ULS) logs.">
      <UrlAction Url="_admin/ULSLogViewer.aspx" />
  </CustomAction>
</Elements>

Deploying the Feature

Deploying the feature is accomplished by creating a new folder under the Features directory and copying the Feature.xml and Elements.xml files into the folder. You must also copy the ULSLogViewer.aspx file into the ADMIN directory. Once the files are copied, you can install the feature and then access it from the Operations tab of the Central Administration site. To make deployment easier, Listing 12-8 shows a batch file you can use to accomplish the required steps. Figure 12-12 shows the resulting page in the Central Administration web site.

Example 12.8. The Batch Installation File

@SET TEMPLATEDIR=
"c:program filescommon filesmicrosoft sharedweb server extensions12Template"
@SET ADMINDIR=
"c:program filescommon filesmicrosoft sharedweb server extensions12Template"
@SET STSADM=
"c:program filescommon filesmicrosoft sharedweb server extensions12instsadm"


MKDIR %TEMPLATEDIR%FEATURESLogViewer
XCOPY Feature.xml %TEMPLATEDIR%FEATURESLogViewer
XCOPY Elements.xml %TEMPLATEDIR%FEATURESLogViewer
XCOPY ULSLogViewer.aspx  %TEMPLATEDIR%Admin
%STSADM% -o installfeature -filename  LogViewerFeature.xml
IISRESET

ECHO "Installation Complete"
PAUSE
The ULS log viewer

Figure 12.12. The ULS log viewer

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216