Creating Managed Property




Go back to index

How to create managed property


Following code block explains how to programmatically create a managed property in SSP.

      using System;
      using SPTool.Library;
      using System.Collections;
      
      namespace SPTool.Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  SPTSharedServiceProvider ssp = new SPTSharedServiceProvider("http://sptool:5000/ssp/admin");

                  // Create Managed Property
                  SPTReturn returnObj = ssp.CreateManagedProperty("SPToolManagedProperty","Text", new ArrayList(new string[]{"ows_Created","ows_Created_x0020_By"}), true, false);

                  // Check the status of managed property creation
                  if (returnObj.State == SPTState.Success)
                  {
                      // Managed Property creation successful
                  }
                  else
                  {
                      // Managed Property creation Failed
                  }                  
              }
          }
      }
      


Go back to index