Deleting Scope Group




Go back to index

How to delete scope group


Following code block explains how to programmatically delete a scope group from a site collection.

      using System;
      using SPTool.Library;
      
      namespace SPTool.Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  SPTSite site = new SPTSite("http://sptool/");

                  // Delete Scope Group
                  SPTReturn returnObj = site.DeleteScopeGroup("SPTool Group");

                  // Check the status of deleting scope group
                  if (returnObj.State == SPTState.Success)
                  {
                      // Scope Group deleted successfully
                  }
                  else
                  {
                      // Deleting Scope Group failed
                  }
              }
          }
      }
      


Go back to index