// Token: 0x06000ABB RID: 2747 RVA: 0x00046114 File Offset: 0x00044314 private void ProcessMailboxForSMS(MailboxInfo mailbox, MailboxSession session, StoreObject item, ADUser user, UMDialPlan dialPlan) { if (mailbox.MapiEvent == null || session == null || item == null) { ExTraceGlobals.MWITracer.TraceDebug((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping for {0} (event={1}, session={2}, item={3})", new object[] { mailbox, mailbox.MapiEvent, session, item }); return; } UMMailbox ummailbox = new UMMailbox(user); if (ummailbox.UMSMSNotificationOption == UMSMSNotificationOptions.None) { ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo>((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping {0}. UMSMSNotificationOptions=None", mailbox); return; } if (MwiAssistant.IsMissedCallMessageEvent(mailbox.MapiEvent) && ummailbox.UMSMSNotificationOption != UMSMSNotificationOptions.VoiceMailAndMissedCalls) { ExTraceGlobals.MWITracer.TraceDebug <MailboxInfo, string>((long)this.GetHashCode(), "MwiAssistant.ProcessMailboxForSMS: Skipping {0}. UMSMSNotificationOptions={1}", mailbox, ummailbox.UMSMSNotificationOption.ToString()); return; } this.SendSMSMessage(mailbox, session, item, user, dialPlan); }
protected void SubmitResetPINMessage(string notifyEmail) { ADUser dataObject = this.DataObject; if (string.IsNullOrEmpty(notifyEmail)) { notifyEmail = dataObject.PrimarySmtpAddress.ToString(); } UMMailbox ummailbox = new UMMailbox(dataObject); UMDialPlan dialPlan = ummailbox.GetDialPlan(); string[] accessNumbers = null; if (dialPlan.AccessTelephoneNumbers != null && dialPlan.AccessTelephoneNumbers.Count > 0) { accessNumbers = dialPlan.AccessTelephoneNumbers.ToArray(); } string extension = null; if (!Utils.TryGetNumericExtension(dialPlan, dataObject, out extension)) { extension = null; } try { Utils.SendPasswordResetMail(dataObject, accessNumbers, extension, this.PinInfo.PIN, notifyEmail); } catch (LocalizedException ex) { base.WriteError(new RecipientTaskException(Strings.SendPINResetMailError(dataObject.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex), ErrorCategory.NotSpecified, null); } }
protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { if (dataObject == null) { return(null); } ADUser aduser = (ADUser)dataObject; if (null != aduser.MasterAccountSid) { aduser.LinkedMasterAccount = SecurityPrincipalIdParameter.GetFriendlyUserName(aduser.MasterAccountSid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose)); aduser.ResetChangeTracking(); } UMMailbox ummailbox = UMMailbox.FromDataObject(aduser); if (ummailbox.UMDialPlan != null) { UMDialPlan dialPlan = ummailbox.GetDialPlan(); if (dialPlan != null && (dialPlan.URIType == UMUriType.E164 || dialPlan.URIType == UMUriType.SipName)) { ummailbox.SIPResourceIdentifier = UMMailbox.GetPrimaryExtension(ummailbox.EmailAddresses, ProxyAddressPrefix.UM); } if (dialPlan != null) { ummailbox.PhoneNumber = ummailbox.GetEUMPhoneNumber(dialPlan); } ummailbox.AccessTelephoneNumbers = dialPlan.AccessTelephoneNumbers; ummailbox.CallAnsweringRulesExtensions = new MultiValuedProperty <string>(Utils.GetExtensionsInDialPlanValidForPAA(dialPlan, aduser)); } return(ummailbox); }
protected override void PrepareRecipientObject(ADUser user) { TaskLogger.LogEnter(); ADUser aduser = this.mailboxPlanObject; if (aduser != null) { user.MailboxPlan = aduser.Id; } else if (user.MailboxPlan != null) { if (user.MailboxPlanObject != null) { aduser = user.MailboxPlanObject; } else { MailboxPlanIdParameter mailboxPlanIdParameter = new MailboxPlanIdParameter(user.MailboxPlan); aduser = (ADUser)base.GetDataObject <ADUser>(mailboxPlanIdParameter, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxPlanNotFound(mailboxPlanIdParameter.ToString())), new LocalizedString?(Strings.ErrorMailboxPlanNotUnique(mailboxPlanIdParameter.ToString())), ExchangeErrorCategory.Client); } this.mailboxPlanObject = aduser; } user.MailboxPlanObject = null; user.propertyBag.ResetChangeTracking(ADRecipientSchema.MailboxPlanObject); if (aduser != null) { using (new CmdletMonitoredScope(base.CurrentTaskContext.UniqueId, "BizLogic", "NewMailboxOrSyncMailbox.PrepareRecipientObject", LoggerHelper.CmdletPerfMonitors)) { ADUser aduser2 = new ADUser(); aduser2.StampPersistableDefaultValues(); aduser2.StampDefaultValues(RecipientType.UserMailbox); aduser2.ResetChangeTracking(); User.FromDataObject(aduser2).ApplyCloneableProperties(User.FromDataObject(aduser)); Mailbox.FromDataObject(aduser2).ApplyCloneableProperties(Mailbox.FromDataObject(aduser)); CASMailbox.FromDataObject(aduser2).ApplyCloneableProperties(CASMailbox.FromDataObject(aduser)); UMMailbox.FromDataObject(aduser2).ApplyCloneableProperties(UMMailbox.FromDataObject(aduser)); bool litigationHoldEnabled = user.LitigationHoldEnabled; ElcMailboxFlags elcMailboxFlags = user.ElcMailboxFlags; user.CopyChangesFrom(aduser2); if (base.SoftDeletedObject != null) { if (litigationHoldEnabled != user.LitigationHoldEnabled) { user.LitigationHoldEnabled = litigationHoldEnabled; } if (elcMailboxFlags != user.ElcMailboxFlags) { user.ElcMailboxFlags = elcMailboxFlags; } } } } base.PrepareRecipientObject(user); MailboxTaskHelper.WriteWarningWhenMailboxIsUnlicensed(user, new Task.TaskWarningLoggingDelegate(this.WriteWarning)); TaskLogger.LogExit(); }
private void WriteResult() { TaskLogger.LogEnter(new object[] { this.DataObject.Id }); UMMailbox sendToPipeline = new UMMailbox(this.DataObject); base.WriteObject(sendToPipeline); TaskLogger.LogExit(); }
private void WriteResult() { TaskLogger.LogEnter(new object[] { this.DataObject.Id }); UMMailbox ummailbox = new UMMailbox(this.DataObject); if (this.ValidateOnly) { ummailbox.SIPResourceIdentifier = this.SIPResourceIdentifier; } base.WriteObject(ummailbox); TaskLogger.LogExit(); }
public SetUMMailboxConfiguration(UMMailbox umMailbox) : base(umMailbox) { this.dialPlan = base.UMMailbox.GetDialPlan(); this.primaryExtension = UMMailbox.GetPrimaryExtension(base.UMMailbox.EmailAddresses, ProxyAddressPrefix.UM); this.secondaryExtensions = new List <UMExtension>(); foreach (ProxyAddress proxyAddress in base.UMMailbox.EmailAddresses) { string extension; string phoneContext; string dpName; if (!proxyAddress.IsPrimaryAddress && proxyAddress.Prefix == ProxyAddressPrefix.UM && UMMailbox.ExtractExtensionInformation(proxyAddress, out extension, out phoneContext, out dpName)) { this.secondaryExtensions.Add(new UMExtension(extension, phoneContext, dpName)); } } }
public void UpdateSecondaryExtensions(UMMailbox mailbox) { ProxyAddressCollection emailAddresses = mailbox.EmailAddresses; EumProxyAddress other = null; for (int i = emailAddresses.Count - 1; i >= 0; i--) { if (emailAddresses[i] is EumProxyAddress) { if (((EumProxyAddress)emailAddresses[i]).IsPrimaryAddress) { other = (EumProxyAddress)emailAddresses[i]; } else { emailAddresses.RemoveAt(i); } } } if (this.SecondaryExtensions != null) { foreach (UMExtension umextension in this.SecondaryExtensions) { if (string.IsNullOrEmpty(umextension.PhoneContext) || string.IsNullOrEmpty(umextension.Extension)) { throw new FaultException(Strings.InvalidSecondaryExtensionError); } ProxyAddress proxyAddress = UMMailbox.BuildProxyAddressFromExtensionAndPhoneContext(umextension.Extension, ProxyAddressPrefix.UM.SecondaryPrefix, umextension.PhoneContext); if (emailAddresses.Contains(proxyAddress)) { if (proxyAddress.Equals(other)) { throw new ProxyAddressExistsException(new LocalizedString(string.Format(Strings.DuplicateExtensionError, proxyAddress))); } throw new FaultException(string.Format(Strings.DuplicateSecondaryExtensionError, proxyAddress)); } else { emailAddresses.Add(proxyAddress); } } } base[MailEnabledRecipientSchema.EmailAddresses] = emailAddresses; }
public static IEnumerable <ADUser> GetUMEnabledUsersInDatabase(MailboxDatabase database) { QueryFilter filter = UMMailbox.GetUMEnabledUserQueryFilter(database); foreach (PartitionId partitionId in ADAccountPartitionLocator.GetAllAccountPartitionIds(true)) { ADSessionSettings settings = ADSessionSettings.FromAllTenantsPartitionId(partitionId); ITenantRecipientSession session = DirectorySessionFactory.Default.CreateTenantRecipientSession(null, null, LcidMapper.DefaultLcid, true, ConsistencyMode.IgnoreInvalid, null, settings, 199, "GetUMEnabledUsersInDatabase", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\PartitionDataAggregator.cs"); ADPagedReader <ADRecipient> recipientReader = session.FindPaged(null, QueryScope.SubTree, filter, null, 0); foreach (ADRecipient recipient in recipientReader) { ADUser user = recipient as ADUser; if (user != null) { yield return(user); } } } yield break; }
// Token: 0x06000AC2 RID: 2754 RVA: 0x00046A90 File Offset: 0x00044C90 private Hashtable GetUMEnabledUsersEnterprise(MailboxDatabase database) { Hashtable hashtable = new Hashtable(); if (database != null) { QueryFilter umenabledUserQueryFilter = UMMailbox.GetUMEnabledUserQueryFilter(database); ADSessionSettings sessionSettings = ADSessionSettings.FromRootOrgScopeSet(); IRecipientSession recipientSession = DirectorySessionFactory.Default.CreateRootOrgRecipientSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 1260, "GetUMEnabledUsersEnterprise", "f:\\15.00.1497\\sources\\dev\\MailboxAssistants\\src\\assistants\\mwi\\MwiAssistant.cs"); ADPagedReader <ADRecipient> adpagedReader = recipientSession.FindPaged(null, QueryScope.SubTree, umenabledUserQueryFilter, null, 0); foreach (ADRecipient adrecipient in adpagedReader) { ADUser aduser = adrecipient as ADUser; if (aduser != null) { hashtable.Add(aduser.ExchangeGuid, aduser.OrganizationId); } } } return(hashtable); }
private WeakPinException CreateWeakPinException(ADUser user) { UMMailboxPolicy policy = new UMMailbox(user).GetPolicy(); LocalizedString localizedString = LocalizedString.Empty; if (policy.PINHistoryCount == 0) { localizedString = Strings.ErrorWeakPasswordNoHistory(policy.MinPINLength); } else if (policy.PINHistoryCount == 1) { localizedString = Strings.ErrorWeakPasswordHistorySingular(policy.MinPINLength); } else { localizedString = Strings.ErrorWeakPasswordHistoryPlural(policy.MinPINLength, policy.PINHistoryCount); } if (!policy.AllowCommonPatterns) { localizedString = Strings.ErrorWeakPasswordWithNoCommonPatterns(localizedString); } return(new WeakPinException(localizedString)); }
internal static bool TryGetUMMailboxPolicy(Trace tracer, UMMailbox mailbox, out UMMailboxPolicy mailboxPolicy) { mailboxPolicy = null; if (!mailbox.UMEnabled || mailbox.UMMailboxPolicy == null) { tracer.TraceWarning <string>(0L, "Recipient is not UM enabled: {0}", mailbox.DistinguishedName); return(false); } UMMailboxPolicy policy = null; ADNotificationAdapter.TryRunADOperation(delegate() { ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(ADSystemConfigurationSession.GetRootOrgContainerIdForLocalForest(), mailbox.OrganizationId, null, false); IConfigurationSession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(true, ConsistencyMode.IgnoreInvalid, sessionSettings, 117, "TryGetUMMailboxPolicy", "f:\\15.00.1497\\sources\\dev\\MailboxTransport\\src\\MailboxTransportDelivery\\StoreDriver\\agents\\UM\\UMAgentUtil.cs"); policy = tenantOrTopologyConfigurationSession.Read <UMMailboxPolicy>(mailbox.UMMailboxPolicy); }); if (policy == null) { tracer.TraceWarning <string, string>(0L, "Could not open mailbox policy {0} for {1}", mailbox.UMMailboxPolicy.DistinguishedName, mailbox.DistinguishedName); return(false); } mailboxPolicy = policy; return(true); }
public SetUMMailboxPinConfiguration(UMMailbox umMailbox) : base(umMailbox) { this.policy = umMailbox.GetPolicy(); }
public UMMailboxRow(UMMailbox umMailbox) : base(umMailbox) { this.UMMailbox = umMailbox; }
public UMMailboxObject(UMMailbox mailbox) : base(mailbox) { this.Mailbox = mailbox; }
public UMBasePinSetConfiguration(UMMailbox umMailbox) : base(umMailbox) { }
public GetVoiceMailBase(UMMailbox mailbox) : base(mailbox) { this.UMMailbox = mailbox; this.UMDialPlan = mailbox.GetDialPlan(); }
public NewUMMailboxConfiguration(UMMailbox umMailbox) : base(umMailbox) { }
public GetVoiceMailSettings(UMMailbox mailbox) : base(mailbox) { }
public GetVoiceMailConfiguration(UMMailbox mailbox) : base(mailbox) { this.UMMailboxPolicy = mailbox.GetPolicy(); this.carrierData = this.GetCarrierData(); }
public UMMailboxFeatureInfo(UMMailbox mailbox) : base(mailbox) { this.Initialize(true, false); this.UMMailboxPolicy = mailbox.UMMailboxPolicy.ToString(); this.WhenChanged = mailbox.WhenChanged.ToString(); }