Go back to index
How to add scopes to scope group
Following code block explains how to programmatically add scopes to scope group in a site collection.
using System;
using SPTool.Library;
using System.Collections;
namespace SPTool.Test
{
class Program
{
static void Main(string[] args)
{
SPTSite site = new SPTSite("http://sptool/");
// Add Scopes to Scope Group
SPTReturn returnObj = site.AddScopesToScopeGroup("SPTool Group", new ArrayList(new string[]{"SPTool Scope"}), false);
// Check the status of adding scopes to scope group
if (returnObj.State == SPTState.Success)
{
// Adding scopes to scope group successful
}
else
{
// Adding scopes to scope group failed
}
}
}
}
Go back to index