WebDAV Global Settings <globalSettings>

Overview

The <globalSettings> element is the parent element for global WebDAV configuration settings. More specifically, this element contains the settings for property and lock provider definitions. The WebDAV module is designed to accept multiple providers, although only a single provider is available for IIS 7 and IIS 7.5.

Note

The <globalSettings> element should not be confused with the <siteDefaults> element, which defines the default settings for Web sites.

Compatibility

Version Notes
IIS 10.0 The <globalSettings> element was not modified in IIS 10.0.
IIS 8.5 The <globalSettings> element was not modified in IIS 8.5.
IIS 8.0 The <globalSettings> element was not modified in IIS 8.0.
IIS 7.5 The <globalSettings> element ships as a feature of IIS 7.5.
IIS 7.0 The <globalSettings> element was introduced in WebDAV 7.0, which was a separate download for IIS 7.0. Only the <propertyStores> element was available in WebDAV 7.0; the <lockStores> element was introduced in WebDAV 7.5.
IIS 6.0 N/A

Note

The WebDAV 7.0 and WebDAV 7.5 modules shipped out-of-band for IIS 7.0, which required downloading and installing the modules from the following URL:

https://www.iis.net/expand/WebDAV

With Windows 7 and Windows Server 2008 R2, the WebDAV 7.5 module ships as a feature for IIS 7.5, so downloading WebDAV is no longer necessary.

Setup

To support WebDAV publishing for your Web server, you must install the WebDAV module. To do so, use the following steps.

Windows Server 2012 or Windows Server 2012 R2

  1. On the taskbar, click Server Manager.
  2. In Server Manager, click the Manage menu, and then click Add Roles and Features.
  3. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
  4. On the Server Roles page, expand Web Server (IIS), expand Web Server, expand Common HTTP Features, and then select WebDAV Publishing. Click Next.
    Screenshot that shows Web DAV Publishing selected for Windows Server 2012.
  5. On the Select features page, click Next.
  6. On the Confirm installation selections page, click Install.
  7. On the Results page, click Close.

Windows 8 or Windows 8.1

  1. On the Start screen, move the pointer all the way to the lower left corner, right-click the Start button, and then click Control Panel.
  2. In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
  3. Expand Internet Information Services, expand World Wide Web Services, expand Common HTTP Features, and then select WebDAV Publishing.
    Screenshot that shows Web DAV Publishing selected for Windows 8.
  4. Click OK.
  5. Click Close.

Windows Server 2008 R2

  1. On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
  2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
  3. In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
  4. On the Select Role Services page of the Add Role Services Wizard, expand Common HTTP Features, select WebDAV Publishing, and then click Next.
    Screenshot that shows Web DAV Publishing selected for Windows Server 2008 in the Add Role Services wizard.
  5. On the Confirm Installation Selections page, click Install.
  6. On the Results page, click Close.

Windows 7

  1. On the taskbar, click Start, and then click Control Panel.
  2. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
  3. Expand Internet Information Services, then World Wide Web Services, and then Common HTTP Features.
  4. Select WebDAV Publishing, and then click OK.
    Screenshot that shows Web DAV Publishing selected for Windows 7.

Windows Server 2008 or Windows Vista

How To

How to configure WebDAV locking for a Web site

  1. Open Internet Information Services (IIS) Manager:

    • If you are using Windows Server 2012 or Windows Server 2012 R2:

      • On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows 8 or Windows 8.1:

      • Hold down the Windows key, press the letter X, and then click Control Panel.
      • Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
    • If you are using Windows Server 2008 or Windows Server 2008 R2:

      • On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows Vista or Windows 7:

      • On the taskbar, click Start, and then click Control Panel.
      • Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
  2. In the Connections pane, expand the server name, expand the Sites node, then click the name of the site.

  3. In the site's Home pane, double-click WebDAV Authoring Rules.
    Screenshot that shows the Server Home pane, with Web DAV Authoring Rules selected.

  4. When the WebDAV Authoring Rules page is displayed, click WebDAV Settings in the Actions pane.

  5. When the WebDAV Settings page is displayed, specify the following options in the Lock Behavior section:

    • Set Allow Locks to True.
    • For Lock Store, choose webdav_simple_lock from the drop-down list.
    • Set Require Lock for Writing to your desired setting.
      Screenshot that shows the Web DAV Settings pane.
  6. Once you have completed the steps, click Apply in the Actions pane.

How to configure WebDAV properties for a Web site

  1. Open Internet Information Services (IIS) Manager:

    • If you are using Windows Server 2012 or Windows Server 2012 R2:

      • On the taskbar, click Server Manager, click Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows 8 or Windows 8.1:

      • Hold down the Windows key, press the letter X, and then click Control Panel.
      • Click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
    • If you are using Windows Server 2008 or Windows Server 2008 R2:

      • On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
    • If you are using Windows Vista or Windows 7:

      • On the taskbar, click Start, and then click Control Panel.
      • Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
  2. In the Connections pane, expand the server name, expand the Sites node, and then click the name of the site.

  3. In the site's Home pane, double-click WebDAV Authoring Rules.
    Screenshot that shows the Default Web Site Home pane. Web DAV is selected.

  4. When the WebDAV Authoring Rules page is displayed, click WebDAV Settings in the Actions pane.
    Screenshot that shows the Web DAV Authoring Rules pane.

  5. When the WebDAV Settings page is displayed, specify the following options in the Property Behavior section:

    • Set Allow anonymous property queries to False.

    • Set Allow custom properties to True.

    • Set Allow property queries with infinite depth to False.

      Screenshot that shows the Web DAV Settings pane. Three fields have been changed.

  6. Click the ellipsis (...) button to launch the Namespace Collection Editor.
    Screenshot that shows the Namespace Collection Editor dialog box.

  7. Click Add and then choose webdav_simple_prop from the drop-down list

  8. Specify "*" for the XmlNameSpace and then click OK.

  9. Once you have completed the previous steps, click Apply in the Actions pane.

Configuration

The <globalSettings> element is only configurable at the global level in the ApplicationHost.config file. Any settings at the site or application level or in Web.config files are ignored.

Attributes

None.

Child Elements

Element Description
propertyStores Optional element.

Specifies the collection of property store providers.
lockStores Optional element. Specifies the collection of lock store providers.

Configuration Sample

The following example lists a sample <globalSettings> element for a WebDAV server. This example defines the built-in simple providers for locks and properties, and enables WebDAV locks for the server.

<system.webServer>
      <webdav>
         <globalSettings>
            <propertyStores>
               <add name="webdav_simple_prop" image="%windir%\system32\inetsrv\webdav_simple_prop.dll" />
            </propertyStores>
            <lockStores>
               <add name="webdav_simple_lock" image="%windir%\system32\inetsrv\webdav_simple_lock.dll" />
            </lockStores>
         </globalSettings>
         <authoring>
            <locks enabled="true" lockStore="webdav_simple_lock" />
         </authoring>
      </webdav>
   </system.webServer>

Sample Code

Note

The propertyStores and lockStores collections are populated with the built-in property and lock providers when you install WebDAV. These provider collections are not extensible at this time, so the code samples in this section are only for reference.

The following examples configure WebDAV global settings to re-add the built-in property and lock providers that are copied to your system when you install the WebDAV module.

AppCmd.exe

appcmd.exe set config -section:system.webServer/webdav/globalSettings /+"propertyStores.[name='webdav_simple_prop',image='%windir%\system32\inetsrv\webdav_simple_prop.dll']" /commit:apphost

appcmd.exe set config -section:system.webServer/webdav/globalSettings /+"lockStores.[name='webdav_simple_lock',image='%windir%\system32\inetsrv\webdav_simple_lock.dll']" /commit:apphost

Note

You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();
         ConfigurationSection globalSettingsSection = config.GetSection("system.webServer/webdav/globalSettings");

         ConfigurationElementCollection propertyStoresCollection = globalSettingsSection.GetCollection("propertyStores");

         ConfigurationElement addElement = propertyStoresCollection.CreateElement("add");
         addElement["name"] = @"webdav_simple_prop";
         addElement["image"] = @"%windir%\system32\inetsrv\webdav_simple_prop.dll";
         propertyStoresCollection.Add(addElement);

         ConfigurationElementCollection lockStoresCollection = globalSettingsSection.GetCollection("lockStores");

         ConfigurationElement addElement1 = lockStoresCollection.CreateElement("add");
         addElement1["name"] = @"webdav_simple_lock";
         addElement1["image"] = @"%windir%\system32\inetsrv\webdav_simple_lock.dll";
         lockStoresCollection.Add(addElement1);

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration
      Dim globalSettingsSection As ConfigurationSection = config.GetSection("system.webServer/webdav/globalSettings")

      Dim propertyStoresCollection As ConfigurationElementCollection = globalSettingsSection.GetCollection("propertyStores")

      Dim addElement As ConfigurationElement = propertyStoresCollection.CreateElement("add")
      addElement("name") = "webdav_simple_prop"
      addElement("image") = "%windir%\system32\inetsrv\webdav_simple_prop.dll"
      propertyStoresCollection.Add(addElement)

      Dim lockStoresCollection As ConfigurationElementCollection = globalSettingsSection.GetCollection("lockStores")

      Dim addElement1 As ConfigurationElement = lockStoresCollection.CreateElement("add")
      addElement1("name") = "webdav_simple_lock"
      addElement1("image") = "%windir%\system32\inetsrv\webdav_simple_lock.dll"
      lockStoresCollection.Add(addElement1)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var globalSettingsSection = adminManager.GetAdminSection("system.webServer/webdav/globalSettings", "MACHINE/WEBROOT/APPHOST");

var propertyStoresCollection = globalSettingsSection.ChildElements.Item("propertyStores").Collection;

var addElement = propertyStoresCollection.CreateNewElement("add");
addElement.Properties.Item("name").Value = "webdav_simple_prop";
addElement.Properties.Item("image").Value = "%windir%\\system32\\inetsrv\\webdav_simple_prop.dll";
propertyStoresCollection.AddElement(addElement);

var lockStoresCollection = globalSettingsSection.ChildElements.Item("lockStores").Collection;

var addElement1 = lockStoresCollection.CreateNewElement("add");
addElement1.Properties.Item("name").Value = "webdav_simple_lock";
addElement1.Properties.Item("image").Value = "%windir%\\system32\\inetsrv\\webdav_simple_lock.dll";
lockStoresCollection.AddElement(addElement1);

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set globalSettingsSection = adminManager.GetAdminSection("system.webServer/webdav/globalSettings", "MACHINE/WEBROOT/APPHOST")

Set propertyStoresCollection = globalSettingsSection.ChildElements.Item("propertyStores").Collection

Set addElement = propertyStoresCollection.CreateNewElement("add")
addElement.Properties.Item("name").Value = "webdav_simple_prop"
addElement.Properties.Item("image").Value = "%windir%\system32\inetsrv\webdav_simple_prop.dll"
propertyStoresCollection.AddElement(addElement)

Set lockStoresCollection = globalSettingsSection.ChildElements.Item("lockStores").Collection

Set addElement1 = lockStoresCollection.CreateNewElement("add")
addElement1.Properties.Item("name").Value = "webdav_simple_lock"
addElement1.Properties.Item("image").Value = "%windir%\system32\inetsrv\webdav_simple_lock.dll"
lockStoresCollection.AddElement(addElement1)

adminManager.CommitChanges()