GetSelfServiceSiteCreationSettings Method
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

SPSite.GetSelfServiceSiteCreationSettings Method

Windows SharePoint Services 3

Returns the settings that are used for Self-Service Site Creation.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public void GetSelfServiceSiteCreationSettings(
	out bool bIsSscEnabled,
	out bool bRequireSecondaryContact,
	out string strInclusionExclusions


Type: System.Boolean
true if Self-Service Site Creation is enabled for the site collection; otherwise, false.
Type: System.Boolean
true if a secondary owner is required for every site that is created by using Self-Service Site Creation; otherwise, false.
Type: System.String
A string in XML format that contains URL namespaces that are included or excluded in the SharePoint Web application.

The following code example displays the Self-Service Site Creation settings for a specified site collection.

bool boolSSCEnabled;
bool boolReqSecondContact;
string strIncludeExclude;

using (SPSite oSiteCollection = new SPSite("http://" + System.Environment.MachineName))
    oSiteCollection.GetSelfServiceSiteCreationSettings(out boolSSCEnabled, out 
    boolReqSecondContact, out strIncludeExclude);

    Console.WriteLine("ssc enabled: "+ boolSSCEnabled.ToString());
    Console.WriteLine("sec contact: "+ boolReqSecondContact.ToString());
    Console.WriteLine("prefix string: "+ strIncludeExclude);

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Best Practices: Using Disposable Windows SharePoint Services Objects.

© 2016 Microsoft