This documentation is archived and is not being maintained.

ProcessModelSection.UserName Property

Gets or sets a value indicating the user name for a Windows identity.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("userName", DefaultValue = "machine")]
public string UserName { get; set; }

Property Value

Type: System.String
The user name. The default value is Machine.

If present, the UserName defines a Windows identity different from that of the default process. This identity is used to run the ASP.NET worker process.

By default, UserName is set to the special value Machine, and the process runs under a user account named ASPNET that is created automatically when ASP.NET is installed.

The Password property must be used with the UserName property.

When present, these property values cause the worker process to run with the configured Windows identity.


If the UserName property is set to System, with the password AutoGenerate, it defines an entity that runs the process as an administrative account and allows all ASP.NET user code running under the process to have full administrative privileges. So, pay close attention to this case, for the permissions allowed.

The following code example shows how to access the UserName property.

                // Get the current UserName property value.
                string userName = 

                // Set the UserName property to "CustomUser".
                processModelSection.UserName = "CustomUser";

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.