Beispiel #1
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            string installPath = ConfigurationContext.Setup.InstallPath;

            try
            {
                this.InstallMPAuditLog(installPath);
            }
            catch (InvalidOperationException)
            {
                EventSourceInstaller.UninstallSecurityEventSource("MSExchange Messaging Policies");
                this.InstallMPAuditLog(installPath);
            }
            TaskLogger.LogExit();
        }
Beispiel #2
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter(new object[]
     {
         this.DataObject
     });
     try
     {
         base.InternalProcessRecord();
     }
     finally
     {
         this.WriteDebugInfo();
     }
     TaskLogger.LogExit();
 }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ADContact adcontact = (ADContact)base.PrepareDataObject();

            if (adcontact.RecipientDisplayType == null)
            {
                adcontact.RecipientDisplayType = new RecipientDisplayType?(RecipientDisplayType.RemoteMailUser);
            }
            if (adcontact.IsChanged(ADRecipientSchema.ExternalEmailAddress))
            {
                MailContactTaskHelper.ValidateExternalEmailAddress(adcontact, this.ConfigurationSession, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
            }
            TaskLogger.LogExit();
            return(adcontact);
        }
Beispiel #4
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (base.HasErrors)
     {
         TaskLogger.LogExit();
         return;
     }
     if (this.Server == null)
     {
         this.Server = ServerIdParameter.Parse("localhost");
     }
     this.ResolveTargetServer();
     TaskLogger.LogExit();
 }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            GALSyncOrganization galsyncOrganization = (GALSyncOrganization)base.PrepareDataObject();

            if (string.IsNullOrEmpty(this.ClientData))
            {
                galsyncOrganization.GALSyncClientData = string.Format("<xml><Version>14.01.0098.00</Version><LastRun>{0}</LastRun></xml>", ExDateTime.Now.ToUtc());
            }
            else
            {
                galsyncOrganization.GALSyncClientData = this.ClientData;
            }
            TaskLogger.LogExit();
            return(galsyncOrganization);
        }
Beispiel #6
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.Identity != null && this.Arbitration.IsPresent)
     {
         MailboxTaskHelper.ValidateArbitrationMailboxHasNoGroups(this.DataObject, base.TenantGlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError), Strings.ErrorDisableMailboxWithAssociatedApprovalRecipents(this.Identity.ToString()));
         MailboxTaskHelper.ValidateNotLastArbitrationMailbox(this.DataObject, base.TenantGlobalCatalogSession, base.RootOrgContainerId, this.DisableLastArbitrationMailboxAllowed.IsPresent, new Task.ErrorLoggerDelegate(base.WriteError), Strings.ErrorCannotDisableLastArbitrationMailboxInOrganization(this.Identity.ToString()));
     }
     if (this.PublicFolder && (this.currentOrganizationId == null || this.currentOrganizationId != this.DataObject.OrganizationId))
     {
         this.currentOrganizationId = this.DataObject.OrganizationId;
         TenantPublicFolderConfigurationCache.Instance.RemoveValue(this.DataObject.OrganizationId);
     }
     TaskLogger.LogExit();
 }
Beispiel #7
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            TDataObject dataObject = this.DataObject;

            if (dataObject.IsModified(ADOrgPersonSchema.UMCallingLineIds))
            {
                this.ValidateUMCallingLineIds();
            }
            if (this.manager != null)
            {
                RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, this.manager, new Task.ErrorLoggerDelegate(base.WriteError));
            }
            TaskLogger.LogExit();
        }
Beispiel #8
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     this.m_output.WriteProgressSimple(Strings.DagTaskRemovingServerFromDag(this.m_ServerName, this.m_stampGroupName));
     this.m_output.WriteProgressSimple(Strings.DagTaskUpdatingAdDagMembership(this.m_ServerName, this.m_stampGroupName));
     base.InternalProcessRecord();
     this.UpdateAdSettings();
     this.m_output.WriteProgressSimple(Strings.DagTaskUpdatedAdDagMembership(this.m_ServerName, this.m_stampGroupName));
     this.m_output.WriteProgressSimple(Strings.DagTaskRemovedServerFromDag(this.m_ServerName, this.m_stampGroupName));
     if (!this.m_configurationOnly)
     {
         this.m_output.WriteProgressSimple(Strings.DagTaskSleepAfterNodeRemoval(60, this.m_stampGroupName, this.m_ServerName));
         Thread.Sleep(60000);
     }
     TaskLogger.LogExit();
 }
Beispiel #9
0
        protected override void InternalBeginProcessing()
        {
            TaskLogger.LogEnter();
            base.InternalBeginProcessing();
            if (base.HasErrors)
            {
                return;
            }
            MailboxServer mailboxServer = (MailboxServer)this.GetDynamicParameters();

            if (base.Fields.IsModified("SubmissionServerOverrideList"))
            {
                mailboxServer.SubmissionServerOverrideList = base.ResolveIdParameterCollection <ServerIdParameter, Server, ADObjectId>(this.SubmissionServerOverrideList, this.ConfigurationSession, null, null, (ExchangeErrorCategory)0, new Func <IIdentityParameter, LocalizedString>(Strings.ErrorServerNotFound), new Func <IIdentityParameter, LocalizedString>(Strings.ErrorServerNotUnique), null, null);
            }
            TaskLogger.LogExit();
        }
Beispiel #10
0
        protected override void WriteResult(IConfigurable dataObject)
        {
            TaskLogger.LogEnter();
            UMIPGateway umipgateway = (UMIPGateway)dataObject;

            this.InitializeForwardingAddress(umipgateway);
            if (this.IncludeSimulator)
            {
                base.WriteResult(dataObject);
            }
            else if (!umipgateway.Simulator)
            {
                base.WriteResult(dataObject);
            }
            TaskLogger.LogExit();
        }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            IConfigurable[] array = base.DataSession.Find <TDataObject>(null, this.RootId, true, null);
            if (array != null && array.Length == 1)
            {
                this.dataObject = (TDataObject)((object)array[0]);
            }
            IVersionable versionable = this.dataObject as IVersionable;

            if (versionable != null && versionable.MaximumSupportedExchangeObjectVersion.IsOlderThan(versionable.ExchangeVersion))
            {
                base.WriteError(new TaskException(Strings.ErrorRemoveNewerObject(this.dataObject.Identity.ToString(), versionable.ExchangeVersion.ExchangeBuild.ToString())), ErrorCategory.InvalidArgument, null);
            }
            TaskLogger.LogExit();
        }
Beispiel #12
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (base.HasErrors)
     {
         return;
     }
     this.database = null;
     if (this.Database != null)
     {
         this.Database.AllowLegacy = true;
         this.database             = (MailboxDatabase)base.GetDataObject <MailboxDatabase>(this.Database, base.GlobalConfigSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(this.Database.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(this.Database.ToString())));
     }
     TaskLogger.LogExit();
 }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            if (base.HasErrors)
            {
                return;
            }
            ADUser aduser = this.DataObject as ADUser;

            if (aduser == null || (aduser.RecipientType != RecipientType.UserMailbox && aduser.RecipientType != RecipientType.MailUser))
            {
                base.WriteError(new RecipientTypeInvalidException(this.Identity.ToString()), ErrorCategory.InvalidData, aduser);
            }
            TaskLogger.LogExit();
        }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            ADRecipient adrecipient = (ADRecipient)base.PrepareDataObject();

            if (this.Picture.IsPresent)
            {
                adrecipient.ThumbnailPhoto = this.data;
            }
            else if (this.SpokenName.IsPresent)
            {
                adrecipient.UMSpokenName = this.data;
            }
            TaskLogger.LogExit();
            return(adrecipient);
        }
Beispiel #15
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     SharedConfigurationTaskHelper.VerifyIsNotTinyTenant(base.CurrentOrgState, new Task.ErrorLoggerDelegate(base.WriteError));
     base.InternalValidate();
     if (this.isDefault)
     {
         this.ConfigurationSession.SessionSettings.IsSharedConfigChecked = true;
         FederatedOrganizationId federatedOrganizationId = this.ConfigurationSession.GetFederatedOrganizationId(this.DataObject.OrganizationId);
         if (federatedOrganizationId != null)
         {
             this.defaultChanged = !this.DataObject.Id.Equals(federatedOrganizationId.DefaultSharingPolicyLink);
         }
     }
     TaskLogger.LogExit();
 }
Beispiel #16
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            Server server = (Server)base.PrepareDataObject();

            if (!base.Fields.IsModified("SubmissionServerOverrideList") && server.IsModified(MailboxServerSchema.SubmissionServerOverrideLIst))
            {
                foreach (ADObjectId adObjectId in server.SubmissionServerOverrideList.Added)
                {
                    ServerIdParameter serverIdParameter = new ServerIdParameter(adObjectId);
                    Server            server2           = (Server)base.GetDataObject <Server>(serverIdParameter, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorServerNotFound(serverIdParameter.ToString())), new LocalizedString?(Strings.ErrorServerNotUnique(serverIdParameter.ToString())));
                }
            }
            TaskLogger.LogExit();
            return(server);
        }
Beispiel #17
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            base.CreateParentContainerIfNeeded(this.DataObject);
            UMDialPlanIdParameter umdialPlan      = this.UMDialPlan;
            IConfigurationSession dialPlanSession = this.GetDialPlanSession();
            UMDialPlan            umdialPlan2     = (UMDialPlan)base.GetDataObject <UMDialPlan>(umdialPlan, dialPlanSession, null, new LocalizedString?(Strings.NonExistantDialPlan(umdialPlan.ToString())), new LocalizedString?(Strings.MultipleDialplansWithSameId(umdialPlan.ToString())));

            if (umdialPlan2.SubscriberType == UMSubscriberType.Consumer)
            {
                this.DataObject.AllowDialPlanSubscribers = false;
                this.DataObject.AllowExtensions          = false;
            }
            base.InternalProcessRecord();
            TaskLogger.LogExit();
        }
Beispiel #18
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     try
     {
         if (this.Identity == null)
         {
             this.Identity = ApprovalApplicationContainerIdParameter.Parse(ApprovalApplicationContainer.DefaultName);
         }
         base.InternalValidate();
     }
     finally
     {
         TaskLogger.LogExit();
     }
 }
Beispiel #19
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            MailboxFolder  dataObject             = this.DataObject;
            MailboxSession mailboxSession         = base.InnerMailboxFolderDataProvider.MailboxSession;
            VersionedId    internalFolderIdentity = dataObject.InternalFolderIdentity;

            using (Folder folder = Folder.Bind(mailboxSession, internalFolderIdentity))
            {
                if (this.InternalProcessPermissions(folder))
                {
                    folder.Save();
                }
            }
            TaskLogger.LogExit();
        }
Beispiel #20
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     try
     {
         base.InternalValidate();
         if (!base.HasErrors)
         {
             this.InternalValidateInternal();
         }
     }
     finally
     {
         TaskLogger.LogExit();
     }
 }
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter(new object[]
            {
                this.DataObject
            });
            TDataObject scratchPad = Activator.CreateInstance <TDataObject>();

            scratchPad.CopyChangesFrom(this.DataObject);
            base.InternalProcessRecord();
            AmServerName amServerName = new AmServerName(this.OwnerServerName);
            TDataObject  dataObject   = this.DataObject;

            SystemConfigurationTasksHelper.DoubleWrite <TDataObject>(dataObject.Identity, scratchPad, amServerName.Fqdn, base.DomainController, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.TaskWarningLoggingDelegate(this.WriteWarning));
            TaskLogger.LogExit();
        }
Beispiel #22
0
        private void CreateReportingWebServiceVDir(string metabasePath, string physicalPath, List <MetabaseProperty> metabaseProperties)
        {
            TaskLogger.LogEnter();
            CreateVirtualDirectory createVirtualDirectory = new CreateVirtualDirectory();

            createVirtualDirectory.Name      = "ReportingWebService";
            createVirtualDirectory.Parent    = metabasePath;
            createVirtualDirectory.LocalPath = physicalPath;
            createVirtualDirectory.CustomizedVDirProperties   = metabaseProperties;
            createVirtualDirectory.ApplicationPool            = "MSExchangeReportingWebServiceAppPool";
            createVirtualDirectory.AppPoolIdentityType        = MetabasePropertyTypes.AppPoolIdentityType.LocalSystem;
            createVirtualDirectory.AppPoolManagedPipelineMode = MetabasePropertyTypes.ManagedPipelineMode.Integrated;
            createVirtualDirectory.Initialize();
            createVirtualDirectory.Execute();
            TaskLogger.LogExit();
        }
Beispiel #23
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.SourceMailbox != null)
     {
         ADUser aduser = RequestTaskHelper.ResolveADUser(base.RecipSession, base.GCSession, base.ServerSettings, this.SourceMailbox, base.OptionalIdentityData, base.DomainController, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), false);
         this.sourceUserId = aduser.Id;
     }
     if (this.TargetMailbox != null)
     {
         ADUser aduser2 = RequestTaskHelper.ResolveADUser(base.RecipSession, base.GCSession, base.ServerSettings, this.TargetMailbox, base.OptionalIdentityData, base.DomainController, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), false);
         this.targetUserId = aduser2.Id;
     }
     TaskLogger.LogExit();
 }
Beispiel #24
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     if (!this.Force && SharedConfiguration.IsSharedConfiguration(this.DataObject.OrganizationId) && !base.ShouldContinue(Strings.ConfirmSharedConfiguration(this.DataObject.OrganizationId.OrganizationalUnit.Name)))
     {
         TaskLogger.LogExit();
         return;
     }
     base.InternalProcessRecord();
     if (this.WellKnownObjectGuid != Guid.Empty)
     {
         IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(null, false, ConsistencyMode.PartiallyConsistent, base.SessionSettings, 424, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RBAC\\RoleGroup\\SetRoleGroup.cs");
         RoleGroupCommon.StampWellKnownObjectGuid(tenantOrTopologyConfigurationSession, this.DataObject.OrganizationId, this.DataObject.DistinguishedName, this.WellKnownObjectGuid);
     }
     TaskLogger.LogExit();
 }
Beispiel #25
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter(new object[]
            {
                this.Identity
            });
            LocalizedString?localizedString;
            IEnumerable <ReducedRecipient> dataObjects = base.GetDataObjects(this.Identity, base.OptionalIdentityData, out localizedString);

            this.WriteResult <ReducedRecipient>(dataObjects);
            if (!base.HasErrors && localizedString != null)
            {
                base.WriteError(new ManagementObjectNotFoundException(localizedString.Value), ErrorCategory.InvalidData, null);
            }
            TaskLogger.LogExit();
        }
 protected override void InternalBeginProcessing()
 {
     TaskLogger.LogEnter();
     this.AppPoolId = "MSExchangePushNotificationsAppPool";
     base.AppPoolManagedPipelineMode = MetabasePropertyTypes.ManagedPipelineMode.Integrated;
     if (this.IsBackEnd)
     {
         this.WebSiteName = "Exchange Back End";
     }
     else
     {
         this.vdirPath = "FrontEnd\\HttpProxy\\PushNotifications";
     }
     base.InternalBeginProcessing();
     TaskLogger.LogExit();
 }
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter(new object[]
     {
         this.DataObject
     });
     if (this.DataObject.IsE15OrLater())
     {
         this.TryCallE15();
     }
     else
     {
         this.TryCallE14();
     }
     TaskLogger.LogExit();
 }
Beispiel #28
0
        protected override void StampChangesOn(IConfigurable dataObject)
        {
            TaskLogger.LogEnter();
            ADOabVirtualDirectory adoabVirtualDirectory = (ADOabVirtualDirectory)dataObject;

            adoabVirtualDirectory.OAuthAuthentication = adoabVirtualDirectory.InternalAuthenticationMethods.Contains(AuthenticationMethod.OAuth);
            adoabVirtualDirectory.RequireSSL          = IisUtility.SSLEnabled(adoabVirtualDirectory.MetabasePath);
            using (DirectoryEntry directoryEntry = IisUtility.CreateIISDirectoryEntry(adoabVirtualDirectory.MetabasePath))
            {
                adoabVirtualDirectory.BasicAuthentication   = IisUtility.CheckForAuthenticationMethod(directoryEntry, AuthenticationMethodFlags.Basic);
                adoabVirtualDirectory.WindowsAuthentication = IisUtility.CheckForAuthenticationMethod(directoryEntry, AuthenticationMethodFlags.Ntlm);
            }
            dataObject.ResetChangeTracking();
            base.StampChangesOn(dataObject);
            TaskLogger.LogExit();
        }
Beispiel #29
0
        protected override void WriteResult(ADObject result)
        {
            TaskLogger.LogEnter(new object[]
            {
                result.Identity
            });
            ADUser aduser = (ADUser)result;

            if (null != aduser.MasterAccountSid)
            {
                aduser.LinkedMasterAccount = SecurityPrincipalIdParameter.GetFriendlyUserName(aduser.MasterAccountSid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
                aduser.ResetChangeTracking();
            }
            base.WriteResult(new MailboxPlan(aduser));
            TaskLogger.LogExit();
        }
Beispiel #30
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (string.IsNullOrEmpty(this.DataObject.ExternalDirectoryOrganizationId))
     {
         base.WriteError(new InvalidOperationException(Strings.ErrorNotMsoOrganization(this.DataObject.OrganizationId.ToString())), (ErrorCategory)1000, null);
     }
     this.recipientFullSyncCookieManager = new MsoRecipientFullSyncCookieManager(Guid.Parse(this.DataObject.ExternalDirectoryOrganizationId));
     this.companyFullSyncCookieManager   = new MsoCompanyFullSyncCookieManager(Guid.Parse(this.DataObject.ExternalDirectoryOrganizationId));
     if (!this.Force && (this.recipientFullSyncCookieManager.ReadCookie() != null || this.companyFullSyncCookieManager.ReadCookie() != null))
     {
         base.WriteError(new ADObjectAlreadyExistsException(Strings.ErrorFullSyncInProgress(this.DataObject.ExternalDirectoryOrganizationId)), (ErrorCategory)1000, null);
     }
     TaskLogger.LogExit();
 }