static void Main(string[] args) { // Instantiate the timer job class SimpleJob simpleJob = new SimpleJob(); // The provided credentials need access to the site collections you want to use // Use generic credential stored in the windows credential manager (control panel -> credential manager) // This makes is possible to safely store the username + password when running on Windows Server simpleJob.UseOffice365Authentication("bertonline"); // In case of SharePoint on-premises use //simpleJob.UseNetworkCredentialsAuthentication("bertonline"); // Add one or more sites to operate on simpleJob.AddSite("https://bertonline.sharepoint.com/sites/dev"); // Print timer job information and then call Run() on the job PrintJobSettingsAndRunJob(simpleJob); }