Management Authentication Credentials <credentials>
Overview
The <credentials>
element of the <authentication>
element specifies credentials for IIS Manager user accounts. IIS Manager users can use IIS Manager to connect to sites and applications for which they are authorized by a server administrator.
Note
The <credentials>
element only applies when you use the default ConfigurationAuthenticationProvider as your authentication provider.
Compatibility
Version | Notes |
---|---|
IIS 10.0 | The <credentials> element was not modified in IIS 10.0. |
IIS 8.5 | The <credentials> element was not modified in IIS 8.5. |
IIS 8.0 | The <credentials> element was not modified in IIS 8.0. |
IIS 7.5 | The <credentials> element was not modified in IIS 7.5. |
IIS 7.0 | The <credentials> element of the <authentication> element was introduced in IIS 7.0. |
IIS 6.0 | N/A |
Setup
The default installation of IIS 7 and later does not include the Management Service role service. To install this role service, use the following steps.
Windows Server 2012 or Windows Server 2012 R2
- On the taskbar, click Server Manager.
- In Server Manager, click the Manage menu, and then click Add Roles and Features.
- In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.
- On the Server Roles page, expand Web Server (IIS), expand Management Tools, and then select Management Service. Click Next.
. - On the Select features page, click Next.
- On the Confirm installation selections page, click Install.
- On the Results page, click Close.
Windows 8 or Windows 8.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.
- In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
- Expand Internet Information Services, expand Web Management Tools, and then select IIS Management Service.
- Click OK.
- Click Close.
Windows Server 2008 or Windows Server 2008 R2
- On the taskbar, click Start, point to Administrative Tools, and then click Server Manager.
- In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).
- In the Web Server (IIS) pane, scroll to the Role Services section, and then click Add Role Services.
- On the Select Role Services page of the Add Role Services Wizard, select Management Service, and then click Next.
- On the Confirm Installation Selections page, click Install.
- On the Results page, click Close.
Windows Vista or Windows 7
- On the taskbar, click Start, and then click Control Panel.
- In Control Panel, click Programs and Features, and then click Turn Windows Features on or off.
- Expand Internet Information Services, then Web Management Tool.
- Select IIS Management Service, and then click OK.
How To
How to enable IIS Manager credentials for a server
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.
In the Connections pane, click the server name.
On the Management Service page, choose Windows credentials or IIS Manager credentials, then click Apply in the Actions pane.
How to add IIS Manager user credentials to a server
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.
In the Connections pane, click the server name.
On the IIS Manager Users page, click Add User... in the Actions pane.
In the Add User dialog box, enter the user name and password, and then click OK.
Configuration
Attributes
None.
Child Elements
Element | Description |
---|---|
add |
Optional element. Adds an IIS Manager user account to the collection of IIS Manager users. |
Configuration Sample
The following configuration sample shows how to add an IIS Manager user named ContosoUser to Administration.config.
<credentials>
<add name="ContosoUser" password="Encrypted-Password-Data" enabled="true" />
</credentials>
Sample Code
The following code samples add an IIS Manager user account named ContosoUser to IIS 7.
AppCmd.exe
Note
You cannot configure <system.webServer/management/authentication>
settings using AppCmd.exe.
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.GetAdministrationConfiguration();
ConfigurationSection authenticationSection = config.GetSection("system.webServer/management/authentication");
ConfigurationElementCollection credentialsCollection = authenticationSection.GetCollection("credentials");
ConfigurationElement addElement = credentialsCollection.CreateElement("add");
addElement["name"] = @"ContosoUser";
addElement["password"] = @"P@ssw0rd";
addElement["enabled"] = true;
credentialsCollection.Add(addElement);
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.GetAdministrationConfiguration
Dim authenticationSection As ConfigurationSection = config.GetSection("system.webServer/management/authentication")
Dim credentialsCollection As ConfigurationElementCollection = authenticationSection.GetCollection("credentials")
Dim addElement As ConfigurationElement = credentialsCollection.CreateElement("add")
addElement("name") = "ContosoUser"
addElement("password") = "P@ssw0rd"
credentialsCollection.Add(addElement)
addElement("enabled") = True
serverManager.CommitChanges()
End Sub
End Module
JavaScript
var adminManager = new ActiveXObject("Microsoft.ApplicationHost.WritableAdminManager");
adminManager.CommitPath = "MACHINE/WEBROOT";
adminManager.SetMetadata("pathMapper", "AdministrationConfig");
var authenticationSection = adminManager.GetAdminSection("system.webServer/management/authentication", "MACHINE/WEBROOT");
var credentialsCollection = authenticationSection.ChildElements.Item("credentials").Collection;
var addElement = credentialsCollection.CreateNewElement("add");
addElement.Properties.Item("name").Value = "ContosoUser";
addElement.Properties.Item("password").Value = "P@ssw0rd";
addElement.Properties.Item("enabled").Value = true;
credentialsCollection.AddElement(addElement);
adminManager.CommitChanges();
VBScript
Set adminManager = WScript.CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT"
adminManager.SetMetadata "pathMapper", "AdministrationConfig"
Set authenticationSection = adminManager.GetAdminSection("system.webServer/management/authentication", "MACHINE/WEBROOT")
Set credentialsCollection = authenticationSection.ChildElements.Item("credentials").Collection
Set addElement = credentialsCollection.CreateNewElement("add")
addElement.Properties.Item("name").Value = "ContosoUser"
addElement.Properties.Item("password").Value = "P@ssw0rd"
addElement.Properties.Item("enabled").Value = True
credentialsCollection.AddElement(addElement)
adminManager.CommitChanges()