static void Main(string[] args) { // Instantiate the timer job class SiteGovernanceJob governanceJob = new SiteGovernanceJob(); // specify the needed information to work app only governanceJob.UseAppOnlyAuthentication(ClientId, ClientSecret); // set enumeration credentials to allow using search API to find the OD4B sites governanceJob.SetEnumerationCredentials(User, Password); // In case of SharePoint on-premises use //governanceJob.SetEnumerationCredentials(User, Password, Domain); // Add one or more sites to operate on governanceJob.AddSite("https://bertonline.sharepoint.com/sites/dev"); // Print timer job information and then call Run() on the job PrintJobSettingsAndRunJob(governanceJob); }
static void Main(string[] args) { // Instantiate the timer job class SiteGovernanceJob governanceJob = new SiteGovernanceJob(); // specify the needed information to work app only governanceJob.UseAppOnlyAuthentication(ClientId, ClientSecret); // set enumeration credentials to allow using search API to find the OD4B sites governanceJob.SetEnumerationCredentials(User, Password); // In case of SharePoint on-premises use //governanceJob.SetEnumerationCredentials(User, Password, Domain); // Add one or more sites to operate on governanceJob.AddSite("https://bertonline.sharepoint.com/sites/dev"); // Print timer job information and then call Run() on the job PrintJobSettingsAndRunJob(governanceJob); }