Share via


ManagementUserInfo.Name Property

Definition

Gets the name of the IIS Manager user.

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

Property Value

The name of the IIS Manager user.

Examples

The following example displays a collection of ManagementUserInfo objects and displays the Name 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;
    }
}

Remarks

The user that the Name property gets is a member of the IIS Manager user collection. The value of the Name property is the same as the return value of the ToString method.

The Name property is stored in the Administration.config file.

Applies to