private static List<SPJobDefinition> GetAdminCmdLineJobs(SPServer server)
 {
     List<SPJobDefinition> list = new List<SPJobDefinition>();
     foreach (KeyValuePair<Guid, SPService> pair in GetLocalProvisionedServices())
     {
         SPService service = pair.Value;
         foreach (SPJobDefinition definition in service.JobDefinitions)
         {
             if (ShouldRunAdminCmdLineJob(definition, server))
             {
                 list.Add(definition);
             }
         }
         SPWebService service2 = service as SPWebService;
         if (service2 != null)
         {
             foreach (SPWebApplication application in service2.WebApplications)
             {
                 foreach (SPJobDefinition definition2 in application.JobDefinitions)
                 {
                     if (ShouldRunAdminCmdLineJob(definition2, server))
                     {
                         list.Add(definition2);
                     }
                 }
             }
             continue;
         }
     }
     return list;
 }
Пример #2
0
        public ServerNode(SPServer server)
        {
            this.Tag = server;

            this.Setup();

            this.Nodes.Add(new ExplorerNodeBase("Dummy"));
        }
Пример #3
0
 public static bool IsWebFrontEnd(SPServer server)
 {
     bool isWFE = false;
     foreach (SPServiceInstance spServiceInstance in server.ServiceInstances)
     {
         if (spServiceInstance is SPWebServiceInstance && spServiceInstance.Status != SPObjectStatus.Disabled && spServiceInstance.Name != "WSS_Administration")
         {
             isWFE = true;
             break;
         }
     }
     return isWFE;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionPackageInstallerJob"/> class.
 /// </summary>
 /// <param name="name">
 /// The name.
 /// </param>
 /// <param name="service">
 /// The service.
 /// </param>
 /// <param name="server">
 /// The server.
 /// </param>
 /// <param name="lockType">
 /// The lock type.
 /// </param>
 private SolutionPackageInstallerJob(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
     this.InitializePackages();
 }
Пример #5
0
 public NodeServiceInstance(SPServer server, NodeService service)
     : base(server, service)
 {
 }
 public CvrServiceInstance(SPServer server, CvrService service) : base(server, service) { }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigServiceInstance"/> class. Use this constructor to install the service instance on servers in the farm.
 /// </summary>
 /// <param name="server">The SPServer to install the instance to.</param>
 /// <param name="service">The service to associate the service instance with.</param>
 internal ConfigServiceInstance(SPServer server, NVRConfigService service)
     : base(server, service)
 {
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Microsoft.SharePoint.Administration.SPJobDefinition"/> class and provides parameters for specifying key objects.
 /// </summary>
 /// <param name="name">Specifies the name of the job definition.</param><param name="service">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPService"/> object instance.</param><param name="server">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPServer"/> object instance.</param><param name="lockType">Specifies an enumeration value from the <see cref="T:Microsoft.SharePoint.Administration.SPJobLockType"/> enum.</param>
 protected DISPJobDefinition(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
     InjectProperties();
 }
Пример #9
0
 /// <summary>
 /// Unused CTOR
 /// </summary>
 /// <param name="jobName">Name of the job</param>
 /// <param name="service">The Service</param>
 /// <param name="server">The server</param>
 /// <param name="targetType">SPJobLockType</param>
 public OrdersMonitoringTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType)
 {
 }
 private static bool ShouldRunAdminCmdLineJob(SPJobDefinition jd, SPServer server)
 {
     if (!(jd is SPAdministrationServiceJobDefinition))
     {
         return false;
     }
     if (jd.GetType().Name == "SPTimerRecycleJobDefinition")
     {
         return false;
     }
     if (!IsApplicableJob(jd, server, false, false))
     {
         return false;
     }
     if (jd.LockType == SPJobLockType.ContentDatabase)
     {
         return false;
     }
     return true;
 }
Пример #11
0
        public SincronizadorTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)

            : base(jobName, service, server, targetType)
        {
        }
 public MigrationContentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #13
0
 public ProfileSyncJob(SPService service, SPServer server, SPJobLockType lockType)
     : base(JobName, service, server, lockType)
 {
     this.Title = JobName;
 }
Пример #14
0
 public MonitoraJob(string jobName, SPService service, SPServer server, SPJobLockType targetType) :
     base(jobName, service, server, targetType)
 {
 }
Пример #15
0
 public SPRequestJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
        protected override void InternalProcessRecord()
        {
            #region validation checks
            // ensure can hit farm
            SPFarm farm = SPFarm.Local;
            if (farm == null)
            {
                ThrowTerminatingError(new InvalidOperationException("SharePoint farm not found."), ErrorCategory.ResourceUnavailable, this);
                SkipProcessCurrentRecord();
            }

            // ensure can hit local server
            SPServer server = SPServer.Local;
            if (server == null)
            {
                ThrowTerminatingError(new InvalidOperationException("SharePoint local server not found."), ErrorCategory.ResourceUnavailable, this);
                SkipProcessCurrentRecord();
            }

            // ensure can hit service application
            DayNamerService service = farm.Services.GetValue <DayNamerService>();
            if (service == null)
            {
                ThrowTerminatingError(new InvalidOperationException("Day Namer Service not found."), ErrorCategory.ResourceUnavailable, this);
                SkipProcessCurrentRecord();
            }

            // ensure can hit app pool
            SPIisWebServiceApplicationPool appPool = this.ApplicationPool.Read();
            if (appPool == null)
            {
                ThrowTerminatingError(new InvalidOperationException("Application pool not found."), ErrorCategory.ResourceUnavailable, this);
                SkipProcessCurrentRecord();
            }
            #endregion

            // Check a service app doesn't already exist
            DayNamerServiceApplication existingServiceApp = service.Applications.GetValue <DayNamerServiceApplication>();
            if (existingServiceApp != null)
            {
                WriteError(new InvalidOperationException("Day Namer Service Application already exists."),
                           ErrorCategory.ResourceExists,
                           existingServiceApp);
                SkipProcessCurrentRecord();
            }

            // Create & provision the service application
            if (ShouldProcess(this.Name))
            {
                DayNamerServiceApplication serviceApp = DayNamerServiceApplication.Create(
                    this.Name,
                    service,
                    appPool);

                // provision the service app
                serviceApp.Provision();

                // pass service app back to the PowerShell
                WriteObject(serviceApp);
            }
        }
Пример #17
0
 public WCF_CallingTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the DeadlineTimerJob class.
 /// </summary>
 /// <param name="jobName">Name of the job.</param>
 /// <param name="service">The service.</param>
 /// <param name="server">The server.</param>
 /// <param name="targetType">Type of the target.</param>
 public TimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RepoServiceInstance"/> class. Use this constructor to install the service instance on servers in the farm.
 /// </summary>
 /// <param name="server">The SPServer to install the instance to.</param>
 /// <param name="service">The service to associate the service instance with.</param>
 internal RepoServiceInstance(SPServer server, RepoService service)
     : base(server, service)
 {
 }
Пример #20
0
 public SyncServiceInstance(SPServer server, SyncService service)
     : base(ServiceInstanceName, server, service)
 {
 }
Пример #21
0
 public STSSyncMonitor(String name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
 }
Пример #22
0
 public SPInstance(ScriptEngine engine, SPBaristaContext context, SPFarm farmContext, SPServer serverContext)
     : base(engine)
 {
     m_context     = new SPContextInstance(Engine, context);
     m_farm        = new SPFarmInstance(Engine.Object.InstancePrototype, farmContext);
     m_server      = new SPServerInstance(Engine.Object.InstancePrototype, serverContext);
     m_secureStore = new SPSecureStoreInstance(Engine.Object.InstancePrototype);
     PopulateFunctions();
 }
 public ClientAccessPolicyDeploymentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #24
0
 public AlertJobdefinition(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 { }
 public ProcessInstructorSchedules(string jobName, SPService service, SPServer server, SPJobLockType lockType) : base(jobName, service, server, lockType)
 {
 }
 private static bool IsApplicableJob(SPJobDefinition jd, SPServer server, bool isRefresh, bool logSpadminDisabledEvent)
 {
     if ((jd.Server != null) && !jd.Server.Id.Equals(server.Id))
     {
         return false;
     }
     if ((jd.LockType == SPJobLockType.ContentDatabase) && !SupportsContentDatabaseJobs(server))
     {
         return false;
     }
     if (!isRefresh)
     {
         return false; // ((jd.Flags & 1) == 0);
     }
     return true;
 }
 public ProcessInstructorSchedules(string jobName, SPWebApplication webApplication, SPServer server, SPJobLockType lockType) : base(jobName, webApplication, server, lockType)
 {
 }
 private static bool SupportsContentDatabaseJobs(SPServer server)
 {
     if (server == null)
     {
         return false;
     }
     SPWebServiceInstance instance = server.ServiceInstances.GetValue<SPWebServiceInstance>();
     if ((instance == null) || (instance.Status != SPObjectStatus.Online))
     {
         return false;
     }
     SPTimerServiceInstance instance2 = server.ServiceInstances.GetValue<SPTimerServiceInstance>();
     return ((instance2 != null) && instance2.AllowContentDatabaseJobs);
 }
Пример #29
0
 public DocTimer(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #30
0
 public ConfigDeploymentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
 public ClientAccessPolicyDeploymentJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
Пример #32
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Microsoft.SharePoint.Administration.SPJobDefinition"/> class and provides parameters for specifying key objects.
 /// </summary>
 /// <param name="name">Specifies the name of the job definition.</param><param name="webApplication">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPWebApplication"/> object instance.</param><param name="server">Specifies an <see cref="T:Microsoft.SharePoint.Administration.SPServer"/> object instance.</param><param name="lockType">Specifies an enumeration value from the <see cref="T:Microsoft.SharePoint.Administration.SPJobLockType"/> enum.</param>
 protected DISPJobDefinition(string name, SPWebApplication webApplication, SPServer server,
                             SPJobLockType lockType)
     : base(name, webApplication, server, lockType)
 {
     InjectProperties();
 }
Пример #33
0
 public UpdateNextDueDateTimerJob(string jobName, SPWebApplication webApp, SPServer server, SPJobLockType lockType, string siteCollectionGuid)
     : base(jobName, webApp, server, lockType)
 {
     this.Title         = jobName;
     SiteCollectionGuid = siteCollectionGuid;
 }
 public MediaProcessingTimerJob(string name,SPServer server)
     : base(name,server)
 {
     this.Title = "Tellago-MediaProcessingTimerJob";
 }
Пример #35
0
 public GENERAL_CustomTimerJob(string jobName, SPService service, SPServer server, SPJobLockType targetType)
     : base(jobName, service, server, targetType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionPackageInstallerJob"/> class.
 /// </summary>
 /// <param name="name">
 /// The name.
 /// </param>
 /// <param name="webApplication">
 /// The web application.
 /// </param>
 /// <param name="server">
 /// The server
 /// </param>
 /// <param name="lockType">
 /// The lock type.
 /// </param>
 private SolutionPackageInstallerJob(string name, SPWebApplication webApplication, SPServer server, SPJobLockType lockType)
     : base(name, webApplication, server, lockType)
 {
     this.InitializePackages();
 }
 /// <summary>
 /// IdentityServiceInstance method implementation
 /// </summary>
 internal IdentityServiceInstance(SPServer server, AdministrationService service) : base(server, service)
 {
 }
 public PackagesDeploymentJob(string name, SPService service, SPServer server, SPJobLockType lockType)
     : base(name, service, server, lockType)
 {
 }
Пример #39
0
 public WorkEngineActivation(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType)
 {
 }
Пример #40
0
 /// <summary>
 /// Initializes a new instance of the DeadlineTimerJob class.
 /// </summary>
 /// <param name="jobName">Name of the job.</param>
 /// <param name="webApplication">The web application.</param>
 /// <param name="server"></param>
 /// <param name="targetType"></param>
 public TimerJob(string jobName, SPWebApplication webApplication, SPServer server, SPJobLockType targetType)
     : base(jobName, webApplication, server, targetType)
 {
     //Title = this.jobName;
 }
 public OceanikServiceInstance(SPServer server, OceanikService service)
     : base(server, service)
 {
 }
Пример #42
0
 public NotificationTimerJob(string jobName, SPService service, SPServer server, SPJobLockType lockType)
     : base(jobName, service, server, lockType)
 {
     Title = jobName;
 }
Пример #43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClubCloudServiceInstance"/> class. Use this constructor to install the service instance on servers in the farm.
 /// </summary>
 /// <param name="server">The SPServer to install the instance to.</param>
 /// <param name="service">The service to associate the service instance with.</param>
 internal ClubCloudServiceInstance(SPServer server, ClubCloudService service)
     : base(server, service)
 {
 }