Chat now with support
Chat with Support

StoragePoint 6.0 - PowerShell and API Reference Guide

PowerShell Guide
StoragePoint PowerShell Overview Getting Started Profile and Endpoint Management Cmdlets Timer Job Scheduling Cmdlets BLOB Information and Migration Cmdlets Miscellaneous SharePoint Utility Cmdlets PowerShell Script Examples StoragePoint API Reference
About Us

TimerJobStatusAPI Reference - Content Migrator Example

The following example is specific to the Content Migrator Job.

 

using Bluethread.SharePoint.StoragePoint.TimerJobAPI;

using Microsoft.SharePoint.Administration;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace StoragePointAPI

{

    public class ContentMigratorExample

    {

        public static void SetRunEveryMinutes_Example()

        {

            int minutes = 50; //Run every 50 minutes

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetRecurrenceDuration(minutes);

            contentMigratorSettings.CommitChanges();

        }

 

        public static void SetNumberOfThreads_Example()

        {

            int numberOfThreads = 5; // number of Threads to run the job

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetRecurrenceDuration(numberOfThreads);

            contentMigratorSettings.CommitChanges();

        }

 

        public static void SetJobRole_Example()

        {

            string jobRole = "standAlone";

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetJobRole(jobRole);

            contentMigratorSettings.CommitChanges();

        }

 

        public static void SetEmailDefault_Example()

        {

            string emailDefault = "True";

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetNotificationEmailDefault(emailDefault);

            contentMigratorSettings.CommitChanges();

        }

 

        public static void SetNotificationEmailOther_Example()

        {

            string emailother = "otherMail@hotmail.com";

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetNotificationEmailOther(emailother);

            contentMigratorSettings.CommitChanges();

        }

 

        public static void SetManyPropertiesOfCMQ_Example()

        {

            string emailother = "otherMail@hotmail.com";

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetNotificationEmailOther(emailother);

            contentMigratorSettings.SetJobRole("standAlone");

            contentMigratorSettings.SetThreads(5);

 

            contentMigratorSettings.CommitChanges();

        }

 

 

        public static void RunJob_Example()

        {

            string serverName = Environment.MachineName;

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.RunJob(SPServer.Local.Name, "standAlone", 5, true"otherMail@hotmail.com""yes"string.Empty);

        }

 

        public static void SetScheduleTime()

        {

            string serverName = Environment.MachineName;

            string startHour = "15:15";

            string endHour = "20:15";

            ContentMigratorJobSettings contentMigratorSettings = ContentMigratorJobSettings.GetInstance(serverName);

            contentMigratorSettings.SetStartHour(startHour);

            contentMigratorSettings.SetEndHour(endHour);

            contentMigratorSettings.CommitChanges();

        }

    }

}

TimerJobStatusAPI Reference - Capacity Monitor Example

This is an example for the Capacity Monitor Job.

 

using Bluethread.SharePoint.StoragePoint.TimerJobAPI;

using Microsoft.SharePoint.Administration;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace StoragePointAPI

{

    public class EndpointCapacityMonitorExamples

    {

 

        public static void SetRunEveryMinutes_Example()

        {

            string serverName = Environment.MachineName;

            int runEveryMinutes = 45;

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.SetRecurrenceDuration(runEveryMinutes);

            endPointCapacityMonitorInstance.CommitChanges();

        }

 

        public static void SetBringOfflineEndPointsOnline_Example()

        {

            string serverName = Environment.MachineName;

            string bringOfflineEndpoint = "yes";

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.SetBringOfflineEndpointsBackOnline(bringOfflineEndpoint);

            endPointCapacityMonitorInstance.CommitChanges();

        }

 

        public static void SetEmailDefault_Example()

        {

            string serverName = Environment.MachineName;

            string emailDefault = true.ToString();

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.SetNotificationEmailDefault(emailDefault);

            endPointCapacityMonitorInstance.CommitChanges();

        }

 

        public static void setNotificationEmailOther()

        {

            string serverName = Environment.MachineName;

            string emailOther = "otherMail@hotmail.com";

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.SetNotificationEmailOther(emailOther);

            endPointCapacityMonitorInstance.CommitChanges();

        }

 

        public static void SetScheduleTime()

        {

            string serverName = Environment.MachineName;

            string startHour = "15:15";

            string endHour = "20:15";

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.SetStartHour(startHour);

            endPointCapacityMonitorInstance.SetEndHour(endHour);

            endPointCapacityMonitorInstance.CommitChanges();

        }

 

        public static void RunJob()

        {

            string serverName = Environment.MachineName;

            EndPointCapacityMonitorJobSettings endPointCapacityMonitorInstance = EndPointCapacityMonitorJobSettings.GetInstance(serverName);

            endPointCapacityMonitorInstance.RunJob(SPServer.Local.Name, "yes"true"otherMail@hotmail.com");

        }

 

 

    }

}

 

TimerJobStatusAPI

The TimerJobStatusAPI retuns lists of timer jobs in their current state (running, completed, etc.)

Timer Job Status API Object Reference

The following can be used to list jobs in the following statuses.

 

         public static List<TimerJobStatusAPI> GetAvailableJobs()

         public static List<TimerJobStatusAPI> GetRunningJobs()

                     public static List<TimerJobStatusAPI> GetCompleteJobs()

                     public static List<TimerJobStatusAPI> GetAbandonedJobs()

                     public static List<TimerJobStatusAPI> GetAbortingJobs()

                     public static List<TimerJobStatusAPI> GetAbortedJobs()

                     public static List<TimerJobStatusAPI> GetSuspendingJobs()

                     public static List<TimerJobStatusAPI> GetSuspendedJobs()

                     public static List<TimerJobStatusAPI> GetResumingJobs()

                     public static List<TimerJobStatusAPI> GetExceptionJobs()                

 

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating