ManagementUserInfoCollection Class

Definition

Represents a collection of IIS Manager users.

public ref class ManagementUserInfoCollection sealed : System::Collections::ObjectModel::Collection<Microsoft::Web::Management::Server::ManagementUserInfo ^>
public sealed class ManagementUserInfoCollection : System.Collections.ObjectModel.Collection<Microsoft.Web.Management.Server.ManagementUserInfo>
type ManagementUserInfoCollection = class
    inherit Collection<ManagementUserInfo>
Public NotInheritable Class ManagementUserInfoCollection
Inherits Collection(Of ManagementUserInfo)
Inheritance
ManagementUserInfoCollection

Examples

The following example displays a collection of ManagementUserInfo objects and displays the property values for each element of the collection.

// 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

This collection contains ManagementUserInfo objects, which are granted permissions to perform management services on the server. Use the Microsoft.Web.Management.Server.ManagementAuthentication.GetUsers(Int32, Int32) method to populate the collection with IIS Manager users. The users in this collection are displayed in the IIS Manager Users page and in the <authentication> section of the Administration.config file. This class cannot be inherited.

Constructors

ManagementUserInfoCollection()

Initializes a new instance of the ManagementUserInfoCollection class.

Applies to