ManagementAuthorizationInfo.ConfigurationPath Property

Definition

Gets the configuration path for which authorization is granted.

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

Property Value

The configuration path in the Administration.config file.

Examples

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

foreach (ManagementAuthorizationInfo authorizedInfo in authorizedCollection)
{
    message = message + "\nName: " + authorizedInfo.Name;
    message = message + "     ConfigurationPath: " + 
        authorizedInfo.ConfigurationPath;
    message = message + "     IsRole: " + authorizedInfo.IsRole;

    // Check to see if the user is already in the allowed users collection.                
    if (userName.Equals(authorizedInfo.Name))
    {
        isInCollection = true;
    }
}

Remarks

The property-value string represents a scope path in the Administration.config file that contains the user Name and IsRole property values. The configuration path determines the node in the Administration.config file that can be searched for authorized users.

The following scope path is extracted from a sample Web site and shows the Name and IsRole values for each authorized user of the configuration path on the Web site.

<scope path="/Default Web Site">

<add name="<computer name>\Administrator" isRole="true"/>

<add name="<computer name>\Guest" isRole="false"/>

<add name="Delta3" isRole="false" />

<add name="securityRole" isRole="true" />

<add name="User5" isRole="false" />

<add name="System.Security.Principal.GenericPrincipal" isRole="true" />

<add name="User7" isRole="false" />

<add name="User4" isRole="false" />

<add name="User1" isRole="false" />

</scope>

Applies to