ServerManagementUnit.GetSite(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a site management unit for the specified site name.
public:
Microsoft::Web::Management::Server::SiteManagementUnit ^ GetSite(System::String ^ siteName);
public Microsoft.Web.Management.Server.SiteManagementUnit GetSite (string siteName);
member this.GetSite : string -> Microsoft.Web.Management.Server.SiteManagementUnit
Public Function GetSite (siteName As String) As SiteManagementUnit
Parameters
- siteName
- String
The name of the site whose information will be retrieved.
Returns
A SiteManagementUnit object that contains site configuration information.
Exceptions
siteName
is null
.
Examples
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();
}
}