Add Office 2007 MimeTypes To IIS Metabase

If you have trouble downloading Office 2007 documents from IIS you may have to add their MimeTypes to the site.

You could do it for the individual extensions by following the steps below:

  1. Select [HTTP Headers] tab from the website properties
  2. Select [Mime Types]
  3. Enter the new extension and the appropriate mime type

To apply the mimetypes globally, you can stop IIS and edit the metabase XML file

C:\WINDOWS\system32\inetsrv\MetaBase.xml

Using a text editor, search for the


 element and append the following lines to the MimeMap attribute:
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template

A Script To Recycle App Pools In IIS

Did you know that there is a script that was shipped with Windows 2003 SP2 that allows you to recycle your IIS Application Pools.

Below is the command that you use from the command line:

Description: list IIS application pools and associated worker process
             Recycle application pools.

Syntax: IIsApp.vbs [{ /a  | /p
 } [/r] ]

Parameters:

Value              Description
/a    Specify an application pool by name. Surround
                    with quotes if it contains spaces.
                   If used alone without an accompanying action,
                   IIsApp.vbs will report PIDs of currently running
                   w3wp.exe processes serving pool .
/p
           Specify a process by process ID. If used alone
                   without an accompanying action, IIsApp.vbs will
                   report the AppPoolId of the w3wp process specified
                   by
. When a PID is specified with /r, that PI
                   is mapped to an application pool and the action is
                   taken upon the application pool. If a PID is given
                   for a web garden, i.e. an application pool served
                   by more than one w3wp, then all w3wp's for that
                   application pool will be acted upon.
/r                 Recycles the application pool.

DEFAULT: no switches will print out the PID and AppPoolId.

Examples:

IIsApp
IIsApp /p 2368
IIsApp /a DefaultAppPool /r
IIsApp /p 2368 /r

A potentially dangerous Request.Form value

We were having trouble adding a user to a site collection.  Every time we hit the search button or clicked the check userid button the system would just sit there and spin. I added the following section of the web.config to resolve the issue.

</compilation>
  <pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
    <namespaces>
      <remove namespace="System.Web.UI.WebControls.WebParts" />
    </namespaces>
    <tagMapping>
      <add tagType="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="Microsoft.SharePoint.WebControls.SPSqlDataSource, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    </tagMapping>
  </pages>
<siteMap defaultProvider="SPSiteMapProvider" enabled="true">

The error that we were getting in the trace logs is similar to below.

Exception Type: System.Web.HttpRequestValidationException  Exception Message: A potentially dangerous Request.Form value was detected from the client (ctl00$PlaceHolderDialogBodySection$ctl04$OriginalEntities="<Entities />").

via Solien Technology

Sharepoint And Alternate Access Paths

I have been wanting to setup a non-www host header for our external websites and found that there are 2 steps to get this working:

  1. Setup an Alternate Access Mapping in the default zone that specifies the domain without the “www”.
  2. Manually add the host header to the IIS properties of the website.

An update conflict has occurred, and you must re-try this action

Lately, we have been getting a lot of errors on our content deployment jobs.  The error that the jobs seem to have in common is “An update conflict has occurred, and you must re-try this action”.

I followed this Microsoft KB Article to resolve the issue: Error message when you try to modify or to delete an alternate access mapping in Windows SharePoint Services 3.0: "An update conflict has occurred, and you must re-try this action" – 939308

Enabling Workflow With Email Enabled Lists

To enable workflow on lists with incoming email enabled you will need to run the following stsadm command:

stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true

via http://support.microsoft.com/kb/953289/

***if you are not fully up to date you will need the infrastructure updates

Shrink SQL Transaction Logs

Here is the t-sql statement used to shrink the SQL transaction logs:

Use <DatabaseName>
Go
Backup Log <DatabaseName> With Truncate_Only
DBCC SHRINKFILE(<TransactionLogName>, 1)
Go

Enabling Anonymous Access

There are several steps that you need to take in order to enable anonymous access.  Below are the steps taken from Microsoft TechNet.

Enable anonymous access for a zone of a Web application
  1. From Administrative Tools, open the SharePoint Central Administration Web site application.

  2. On the Central Administration home page, click Application Management.

  3. On the Application Management page, in the Application Security section, click Authentication providers.

  4. On the Authentication Providers page, make sure the Web application that is listed in the Web Application box (under Site Actions) is the one that you want to configure. If the listed Web application is not the one that you want to configure, click the drop-down arrow to the right of the Web Application drop-down list box and select Change Web Application.

  5. In the Select Web Application dialog box, click the Web application that you want to configure.

  6. On the Authentication Providers page, click the zone of the Web application on which you want to enable anonymous access. The zones that are configured for the selected Web application are listed on the Authentication Providers page.

  7. On the Edit Authentication page, in the Anonymous Access section, select Enable Anonymous Access, and then click Save.

At this point, the Web application zone has been enabled for anonymous access.

Enable anonymous access for individual sites

Now you need to enable anonymous access for individual sites in the site collection.

Enable anonymous access for individual sites
  1. Go to the site on which you want to enable anonymous access and click the Site Actions menu.

  2. On the Site Actions menu, click Site Settings.

  3. On the Site Settings page, in the Users and Permissions section, click Advanced Permissions.

  4. On the Permissions page, on the Settings menu, click Anonymous Access. The settings for anonymous access lists three options:

    • Entire Web site   Select this option if you want to enable anonymous access for the entire Web site.

    • Lists and libraries   Select this option if you want to limit anonymous access to only the lists and libraries on your site.

    • Nothing   Select this option if you want to prevent anonymous access from being used on your site.

  5. Click OK.

At this point, your site is configured for anonymous access based on the options that you have selected.

Enable anonymous access for individual lists

If you select Lists and libraries, enable anonymous access for individual lists.

Enable anonymous access for individual lists
  1. Go to the home page of your Web site and, in the left navigation pane, click View All Site Content.

  2. Click the list on which you want to enable anonymous access.

  3. On the Settings menu, click List Settings.

  4. On the Customize List page, in the Permissions and Management section, click Permissions for this list.

  5. On the Permissions page, on the Actions menu, click Edit Permissions. A dialog box is displayed informing you that you are about to create unique permissions for this list. Click OK.

  6. On the Settings menu, click Anonymous Access.

  7. Select permissions for users who have anonymous access to the list, and then click OK.

At this point, users have anonymous access to the list you have configured. You can control whether users have anonymous access to other lists, the home page, or other pages on this site.

Setting The User’s Time Zone

The Sharepoint Knowledge Base blog has a great post about setting the user’s Time Zone and other locale info.

Change Central Admin Port

Change the Central Administration Web site port number

Use this procedure to change the port number of the Central Administration Web site.

Change the Central Administration Web site port number by using the Stsadm command-line tool
  1. On the drive where SharePoint Products and Technologies is installed, open a command-line window and type the following command: cd %CommonProgramFiles%\Microsoft Shared\Web Server Extensions\12\bin

  2. To determine the current port number for the Central Administration Web site, at the command prompt, type the following command, and then press ENTER: stsadm -o getadminport

    For more information, see Getadminport.

  3. To change the port number for the Central Administration Web site, use the following command, including any options that apply to your environment: stsadm -o setadminport -port <port> [-ssl] [-admapcreatenew] [-admapidname] <application pool name>

    For more information, see Setadminport.

Note: You can only change the port number for the Central Administration Web site by using the Stsadm command-line tool.

via Microsoft Technet