예제 #1
0
        static void Main()
        {
            var job = new EnforceTwoAdministratorsTimerJob();

            var provisioningJobs = ProvisioningRepositoryFactory.Current.GetTypedProvisioningJobs <SiteCollectionProvisioningJob>(ProvisioningJobStatus.Provisioned);

            foreach (SiteCollectionProvisioningJob provisioningJob in provisioningJobs)
            {
                var url = PnPPartnerPackSettings.InfrastructureSiteUrl.Substring(0, PnPPartnerPackSettings.InfrastructureSiteUrl.IndexOf(".com/") + 4) + provisioningJob.RelativeUrl;
                job.AddSite(url);
            }

            job.UseAzureADAppOnlyAuthentication(
                PnPPartnerPackSettings.ClientId,
                PnPPartnerPackSettings.Tenant,
                PnPPartnerPackSettings.AppOnlyCertificate);

            job.Run();
        }
예제 #2
0
        static void Main()
        {
            var job = new EnforceTwoAdministratorsTimerJob();

            var provisioningJobs = ProvisioningRepositoryFactory.Current.GetTypedProvisioningJobs<SiteCollectionProvisioningJob>(ProvisioningJobStatus.Provisioned);

            foreach (SiteCollectionProvisioningJob provisioningJob in provisioningJobs)
            {
                var url = PnPPartnerPackSettings.InfrastructureSiteUrl.Substring(0, PnPPartnerPackSettings.InfrastructureSiteUrl.IndexOf(".com/") + 4) + provisioningJob.RelativeUrl;
                job.AddSite(url);
            }

            job.UseAzureADAppOnlyAuthentication(
                        PnPPartnerPackSettings.ClientId,
                        PnPPartnerPackSettings.Tenant,
                        PnPPartnerPackSettings.AppOnlyCertificate);

            job.Run();

        }