Share via


ManagementUserInfo.Enabled Property

Definition

Gets a value indicating whether the IIS Manager user can perform management services in IIS Manager.

public:
 property bool Enabled { bool get(); };
public bool Enabled { get; }
member this.Enabled : bool
Public ReadOnly Property Enabled As Boolean

Property Value

true if the IIS Manager user is enabled; otherwise, false. The default is true.

Examples

The following example displays a collection of ManagementUserInfo objects and displays the Enabled property values for each element of the collection. This code example is part of a larger example provided for the ManagementUserInfo class.

// Create a new ManagementUser.
string managementusername = "SuperManager";
string managementuserpassword = "password";
string message = null;
string display = null;
ManagementUserInfoCollection managementUserInfoCollection = 
    ManagementAuthentication.GetUsers(0, -1);
message = "\nUsers count: " + managementUserInfoCollection.Count.ToString();
display = display + message;
bool isInCollection = false;
message = null;
foreach (ManagementUserInfo userInfo in managementUserInfoCollection)
{
    message = message + "\nName: " + userInfo.Name;
    message = message + "     Enabled: " + userInfo.Enabled;
    message = message + "     ToString: " + userInfo.ToString();
    // Check to see if the management user is already in the collection.
    if (managementusername.Equals(userInfo.Name))
    {
        isInCollection = true;
    }
}

Applies to