Example #1
0
        /// <summary>
        /// Takes over the settings from the passed timer job. Is useful when you run multiple jobs in a row or chain 
        /// job execution. Settings that are taken over are all the authentication, enumeration settings and SharePointVersion
        /// </summary>
        /// <param name="job"></param>
        public void Clone(TimerJob job)
        {
            this.username = job.username;
            this.password = job.password;
            this.domain = job.domain;
            this.enumerationUser = job.enumerationUser;
            this.enumerationPassword = job.enumerationPassword;
            this.enumerationDomain = job.enumerationDomain;
            this.authenticationType = job.authenticationType;
            this.realm = job.realm;
            this.clientId = job.clientId;
            this.clientSecret = job.clientSecret;
            this.sharePointVersion = job.sharePointVersion;

            Log.Info(Constants.LOGGING_SOURCE, CoreResources.TimerJob_Clone, job.Name, this.Name);
        }
Example #2
0
        private static void PrintJobSettingsAndRunJob(TimerJob job)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("************************************************");
            Console.WriteLine("Job name: {0}", job.Name);
            Console.WriteLine("Job version: {0}", job.Version);
            Console.WriteLine("Use threading: {0}", job.UseThreading);
            Console.WriteLine("Maximum threads: {0}", job.MaximumThreads);
            Console.WriteLine("Expand sub sites: {0}", job.ExpandSubSites);
            Console.WriteLine("Authentication type: {0}", job.AuthenticationType);
            Console.WriteLine("Manage state: {0}", job.ManageState);
            Console.WriteLine("SharePoint version: {0}", job.SharePointVersion);
            Console.WriteLine("************************************************");
            Console.ForegroundColor = ConsoleColor.Gray;

            //Run job
            job.Run();
        }