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.

System_CAPS_noteNote

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 = 
  processModelSection.UserName;

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

.NET Framework
Available since 2.0
Return to top
Show: