Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

SPGlobalAdmin class

NOTE: This API is now obsolete.

In Windows SharePoint Services 2.0, SPGlobalAdmin represented the top-level object for administration of a deployment, and is maintained for backward compatibility. Use the new SPFarm and SPWebService classes instead, to manage a SharePoint Foundation deployment.

System.Object
  Microsoft.SharePoint.Administration.SPGlobalAdmin

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[ObsoleteAttribute("Most of the functionality in this class is available in SPFarm or SPWebService.", 
	false)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class SPGlobalAdmin : IDisposable

The following code example displays the SharePoint administrators group account, the host name for the specified virtual server, and usage information for all SharePoint sites on the server.

This example assumes the existence of a label control on an .aspx page.

SPGlobalAdmin globAdmin = new SPGlobalAdmin();
SPGlobalConfig globConfig= globAdmin.Config;
SPVirtualServer vServer = globAdmin.VirtualServers[0];

Label1.Text += "Administrator Group: " + globConfig.AdminGroup + 
    "Host: " + vServer.HostName + "<BR>";

SPSiteCollection sites = vServer.Sites;

foreach (SPSite site in sites)
{
    SPSite.UsageInfo uInfo = site.Usage;

    Label1.Text += "URL: " + site.Url + " Bandwidth: " + uInfo.Bandwidth.ToString() +
    " Hits: " + uInfo.Hits.ToString() +" Visits: " + uInfo.Visits.ToString() + "<BR>";
}
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.