Export (0) Print
Expand All

ServerManagementUnit Class

IIS 7.0

Encapsulates contextual information about the server being managed.

System..::..Object
  Microsoft.Web.Management.Server..::..ManagementUnit
    Microsoft.Web.Management.Server..::..ServerManagementUnit

Namespace:  Microsoft.Web.Management.Server
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

public sealed class ServerManagementUnit : ManagementUnit

The ServerManagementUnit type exposes the following members.

  NameDescription
Public propertyAdministrationGets the current management administration configuration. (Inherited from ManagementUnit.)
Public propertyConfigurationGets configuration information for the current management unit. (Inherited from ManagementUnit.)
Public propertyConfigurationMapGets the configuration map for the management unit. (Inherited from ManagementUnit.)
Public propertyConfigurationPathGets the configuration path information for the current management unit. (Inherited from ManagementUnit.)
Public propertyContextGets management context information for the current management unit. (Inherited from ManagementUnit.)
Public propertyFrameworkVersionGets the .NET Framework version for the current management unit. (Inherited from ManagementUnit.)
Public propertyFrameworkVersionsGets the installed .NET Framework versions for the current management unit context.
Public propertyIsUserServerAdministratorGets a value indicating whether the calling user is a server administrator. (Inherited from ManagementUnit.)
Public propertyMachineNameGets the computer name of the server.
Public propertyScopeGets the scope of the server management unit. (Overrides ManagementUnit..::..Scope.)
Public propertyServerManagerGets the server manager for the management unit. (Inherited from ManagementUnit.)
Top

  NameDescription
Protected methodCreateConfigurationMapWhen overridden in a derived class, creates a file map that contains global configuration information that is applicable to this management unit. (Inherited from ManagementUnit.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetApplicationReturns an application management unit for the specified site name and application path.
Protected methodGetAssociatedFrameworkVersionWhen overridden in a derived class, returns the .NET Framework version for the management unit. (Inherited from ManagementUnit.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetModuleProvidersReturns a collection of module providers of the specified type. (Inherited from ManagementUnit.)
Public methodGetModuleServiceRetrieves the ModuleService object that corresponds to the specified module name. (Inherited from ManagementUnit.)
Public methodGetSiteReturns a site management unit for the specified site name.
Public methodGetType (Inherited from Object.)
Public methodGetTypeInformation(String)When the GetTypeInformation(String, Boolean, Type) method is overridden in a derived class, retrieves the assembly-qualified type names for all types in the current management scope that derive from the specified base type name. (Inherited from ManagementUnit.)
Public methodGetTypeInformation(String, Boolean)When the GetTypeInformation(String, Boolean, Type) method is overridden in a derived class, retrieves the assembly-qualified type names for all types in the current management scope that derive from the specified base type name, optionally including types that are not public. (Inherited from ManagementUnit.)
Public methodGetTypeInformation(String, Boolean, Type)Returns public type information for the specified base type name and generator type, and optionally includes non-public types. (Overrides ManagementUnit..::..GetTypeInformation(String, Boolean, Type).)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Public methodUpdateCommits changes on the ManagementUnit. (Inherited from ManagementUnit.)
Top

The ServerManagementUnit class accesses configuration information at the root level (the ApplicationHost.config or root Web.config file). For more information, see the SiteManagementUnit and ApplicationManagementUnit classes. You cannot create a ServerManagementUnit object directly; you can get one only from the ModuleProvider..::..ManagementUnit property.

The following example sends ServerManagementUnit information to the trace listener.

void traceMU() {

    ServerManagementUnit smu = ManagementUnit as ServerManagementUnit;

    if (smu != null) {
        string FMV = smu.FrameworkVersions.ToString();
        Trace.WriteLine("FrameworkVersions = " + FMV);
        Trace.WriteLine("MachineName = " + smu.MachineName);
        ApplicationManagementUnit amu =
            smu.GetApplication("rickaSite", "/ra");
        Trace.WriteLine("App FrameworkVersion = "
            + amu.FrameworkVersion.Text);
        SiteManagementUnit rickaSMU = smu.GetSite("rickaSite");
        string rwcp = rickaSMU.ConfigurationMap.RootWebConfigurationPath;
        Trace.WriteLine("RootWebConfigurationPath = " + rwcp);
        ManagementScope ms = smu.Scope;
        Trace.WriteLine("Scope = " + ms.ToString());


    } else {

        ApplicationManagementUnit appUnit = 
            ManagementUnit as ApplicationManagementUnit;
        if (appUnit != null)
            traceAppUnit();
    }

} 


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft