public static void GetObjectPostAction(DataRow inputRow, DataTable table, DataObjectStore store) { DataRow dataRow = table.Rows[0]; if (dataRow["SimpleEmailAddresses"] != DBNull.Value) { dataRow["EmailAddresses"] = EmailAddressList.FromProxyAddressCollection((ProxyAddressCollection)dataRow["SimpleEmailAddresses"]); } if (dataRow["ObjectCountryOrRegion"] != DBNull.Value) { dataRow["CountryOrRegion"] = ((CountryInfo)dataRow["ObjectCountryOrRegion"]).Name; } MailboxPropertiesHelper.GetMaxSendReceiveSize(inputRow, table, store); MailboxPropertiesHelper.GetAcceptRejectSendersOrMembers(inputRow, table, store); if (dataRow["EmailAddresses"] != DBNull.Value && dataRow["RemoteRoutingAddress"] != DBNull.Value) { EmailAddressList emailAddressList = (EmailAddressList)dataRow["EmailAddresses"]; string strA = (string)dataRow["RemoteRoutingAddress"]; foreach (EmailAddressItem emailAddressItem in emailAddressList) { string identity = emailAddressItem.Identity; if (string.Compare(strA, identity, true) == 0) { dataRow["RemoteRoutingAddress"] = identity; break; } } } dataRow["IsRemoteUserMailbox"] = ((RecipientTypeDetails)((ulong)int.MinValue)).Equals(dataRow["RecipientTypeDetails"]); }
public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { PublicFolder publicFolder = store.GetDataObject("PublicFolder") as PublicFolder; PublicFolderStatistics publicFolderStatistics = store.GetDataObject("PublicFolderStatistics") as PublicFolderStatistics; if (dataTable.Rows.Count == 1) { DataRow dataRow = dataTable.Rows[0]; if (publicFolder != null) { dataRow["IsStorageQuotasSet"] = (publicFolder.IssueWarningQuota == null || (publicFolder.IssueWarningQuota.Value.IsUnlimited && publicFolder.ProhibitPostQuota.Value.IsUnlimited && publicFolder.MaxItemSize.Value.IsUnlimited)); dataRow["IssueWarningQuota"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(publicFolder.IssueWarningQuota); dataRow["ProhibitPostQuota"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(publicFolder.ProhibitPostQuota); dataRow["MaxItemSize"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(publicFolder.MaxItemSize); dataRow["IsRetainDeletedItemsForSet"] = (publicFolder.RetainDeletedItemsFor == null); dataRow["RetainDeletedItemsFor"] = ((publicFolder.RetainDeletedItemsFor != null) ? publicFolder.RetainDeletedItemsFor.Value.Days.ToString() : "5"); dataRow["IsAgeLimitSet"] = (publicFolder.AgeLimit == null); dataRow["AgeLimit"] = ((publicFolder.AgeLimit != null && publicFolder.AgeLimit != null) ? publicFolder.AgeLimit.Value.Days.ToString() : "5"); } if (publicFolderStatistics != null) { dataRow["TotalItemSize"] = publicFolderStatistics.TotalItemSize.ToMB().ToString(); dataRow["TotalAssociatedItemSize"] = ((!publicFolderStatistics.TotalAssociatedItemSize.IsNullValue()) ? publicFolderStatistics.TotalAssociatedItemSize.ToMB() : 0UL); dataRow["TotalDeletedItemSize"] = ((!publicFolderStatistics.TotalDeletedItemSize.IsNullValue()) ? publicFolderStatistics.TotalDeletedItemSize.ToMB() : 0UL); } } }
public static void SetObjectPreAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { DataRow dataRow = dataTable.Rows[0]; List <string> list = new List <string>(); MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "IssueWarningQuota", list); MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "ProhibitSendQuota", list); MailboxPropertiesHelper.SaveQuotaProperty(dataRow, null, "ProhibitSendReceiveQuota", list); if (DBNull.Value != dataRow["DeletedItemRetention"]) { dataRow["DeletedItemRetention"] = EnhancedTimeSpan.Parse((string)dataRow["DeletedItemRetention"]); list.Add("DeletedItemRetention"); } if (DBNull.Value != dataRow["MailboxRetention"]) { dataRow["MailboxRetention"] = EnhancedTimeSpan.Parse((string)dataRow["MailboxRetention"]); list.Add("MailboxRetention"); } DatabasePropertiesHelper.SetScheduleProperty(dataRow, "MaintenanceSchedule", list); DatabasePropertiesHelper.SetScheduleProperty(dataRow, "QuotaNotificationSchedule", list); if (list.Count != 0) { store.SetModifiedColumns(list); } }
protected PowerShellResults <T> GetDistributionGroup <T>(Identity identity) where T : DistributionGroup { PowerShellResults <T> @object = base.GetObject <T>("Get-DistributionGroup", identity); if (@object.SucceededWithValue) { PowerShellResults <WindowsGroup> powerShellResults = @object.MergeErrors <WindowsGroup>(base.GetObject <WindowsGroup>("Get-Group", identity)); if (powerShellResults.SucceededWithValue) { T value = @object.Value; value.WindowsGroup = powerShellResults.Value; } if (RbacPrincipal.Current.IsInRole("Enterprise+Get-ADPermission?Identity")) { PowerShellResults <ADAcePresentationObject> powerShellResults2 = @object.MergeErrors <ADAcePresentationObject>(base.GetObject <ADAcePresentationObject>(new PSCommand().AddCommand("Get-ADPermission").AddParameter("Identity", identity))); if (powerShellResults2.Output.Length > 0) { T value2 = @object.Value; value2.SendAsPermissionsEnterprise = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionEnt(powerShellResults2.Output, null); } } else if (RbacPrincipal.Current.IsInRole("MultiTenant+Get-RecipientPermission?Identity")) { PowerShellResults <RecipientPermission> powerShellResults3 = @object.MergeErrors <RecipientPermission>(base.GetObject <RecipientPermission>(new PSCommand().AddCommand("Get-RecipientPermission").AddParameter("Identity", identity))); if (powerShellResults3.Output.Length > 0) { T value3 = @object.Value; value3.SendAsPermissionsCloud = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionCloud(powerShellResults3.Output); } } } return(@object); }
public static void GetListPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { foreach (object obj in dataTable.Rows) { DataRow dataRow = (DataRow)obj; RecipientTypeDetails recipientTypeDetails = (RecipientTypeDetails)dataRow["RecipientTypeDetails"]; dataRow["IsRoom"] = (recipientTypeDetails == RecipientTypeDetails.RoomMailbox); dataRow["MailboxType"] = MailboxPropertiesHelper.TranslateMailboxTypeForListview(recipientTypeDetails, false, Guid.Empty); } }
public static void GetRemoteMailboxPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { DataRow row = dataTable.Rows[0]; RemoteMailbox remoteMailbox = store.GetDataObject("RemoteMailbox") as RemoteMailbox; if (remoteMailbox != null) { MailboxPropertiesHelper.TrySetColumnValue(row, "MailboxCanHaveArchive", remoteMailbox.ExchangeVersion.CompareTo(ExchangeObjectVersion.Exchange2010) >= 0 && (remoteMailbox.RecipientTypeDetails == (RecipientTypeDetails)((ulong)int.MinValue) || remoteMailbox.RecipientTypeDetails == RecipientTypeDetails.RemoteRoomMailbox || remoteMailbox.RecipientTypeDetails == RecipientTypeDetails.RemoteEquipmentMailbox || remoteMailbox.RecipientTypeDetails == RecipientTypeDetails.RemoteSharedMailbox)); MailboxPropertiesHelper.TrySetColumnValue(row, "EnableArchive", remoteMailbox.ArchiveState != ArchiveState.None); MailboxPropertiesHelper.TrySetColumnValue(row, "HasArchive", remoteMailbox.ArchiveState != ArchiveState.None); MailboxPropertiesHelper.TrySetColumnValue(row, "RemoteArchive", remoteMailbox.ArchiveState == ArchiveState.HostedProvisioned || remoteMailbox.ArchiveState == ArchiveState.HostedPending); } }
public static void SetObjectPreAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { DataRow dataRow = dataTable.Rows[0]; List <string> list = new List <string>(); if (DBNull.Value != inputRow["IssueWarningQuota"] || DBNull.Value != inputRow["ProhibitPostQuota"] || DBNull.Value != inputRow["MaxItemSize"] || DBNull.Value != inputRow["IsStorageQuotasSet"]) { if (DBNull.Value != inputRow["IsStorageQuotasSet"] && (bool)inputRow["IsStorageQuotasSet"]) { dataRow["IssueWarningQuota"] = Unlimited <ByteQuantifiedSize> .UnlimitedString; dataRow["ProhibitPostQuota"] = Unlimited <ByteQuantifiedSize> .UnlimitedString; dataRow["MaxItemSize"] = Unlimited <ByteQuantifiedSize> .UnlimitedString; } MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "IssueWarningQuota", list); MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "ProhibitPostQuota", list); MailboxPropertiesHelper.SaveQuotaProperty(dataRow, "IsStorageQuotasSet", "MaxItemSize", list); } if (DBNull.Value != inputRow["RetainDeletedItemsFor"] || DBNull.Value != inputRow["IsRetainDeletedItemsForSet"]) { if (DBNull.Value != inputRow["IsRetainDeletedItemsForSet"] && (bool)inputRow["IsRetainDeletedItemsForSet"]) { dataRow["RetainDeletedItemsFor"] = null; } else { dataRow["RetainDeletedItemsFor"] = EnhancedTimeSpan.Parse((string)dataRow["RetainDeletedItemsFor"]); } list.Add("RetainDeletedItemsFor"); list.Add("IsRetainDeletedItemsForSet"); } if (DBNull.Value != inputRow["AgeLimit"] || DBNull.Value != inputRow["IsAgeLimitSet"]) { if (DBNull.Value != inputRow["IsAgeLimitSet"] && (bool)inputRow["IsAgeLimitSet"]) { dataRow["AgeLimit"] = null; } else { dataRow["AgeLimit"] = EnhancedTimeSpan.Parse((string)dataRow["AgeLimit"]); } list.Add("AgeLimit"); list.Add("IsAgeLimitSet"); } MailboxPropertiesHelper.SetMaxSendReceiveSize(inputRow, dataTable, store); if (list.Count > 0) { store.SetModifiedColumns(list); } }
public static void GetObjectPostAction(DataRow inputRow, DataTable table, DataObjectStore store) { DataRow dataRow = table.Rows[0]; if (dataRow["SimpleEmailAddresses"] != DBNull.Value) { dataRow["EmailAddresses"] = EmailAddressList.FromProxyAddressCollection((ProxyAddressCollection)dataRow["SimpleEmailAddresses"]); } if (dataRow["ObjectCountryOrRegion"] != DBNull.Value) { dataRow["CountryOrRegion"] = ((CountryInfo)dataRow["ObjectCountryOrRegion"]).Name; } MailboxPropertiesHelper.GetMaxSendReceiveSize(inputRow, table, store); MailboxPropertiesHelper.GetAcceptRejectSendersOrMembers(inputRow, table, store); }
public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { DataRow dataRow = dataTable.Rows[0]; if (!DBNull.Value.Equals(dataRow["IssueWarningQuota"])) { Unlimited <ByteQuantifiedSize> unlimited = (Unlimited <ByteQuantifiedSize>)dataRow["IssueWarningQuota"]; dataRow["IssueWarningQuota"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(unlimited); } if (!DBNull.Value.Equals(dataRow["ProhibitSendQuota"])) { Unlimited <ByteQuantifiedSize> unlimited2 = (Unlimited <ByteQuantifiedSize>)dataRow["ProhibitSendQuota"]; dataRow["ProhibitSendQuota"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(unlimited2); } if (!DBNull.Value.Equals(dataRow["ProhibitSendReceiveQuota"])) { Unlimited <ByteQuantifiedSize> unlimited3 = (Unlimited <ByteQuantifiedSize>)dataRow["ProhibitSendReceiveQuota"]; dataRow["ProhibitSendReceiveQuota"] = MailboxPropertiesHelper.UnlimitedByteQuantifiedSizeToString(unlimited3); } dataRow["MountStatus"] = ((DDIHelper.IsEmptyValue(dataRow["Mounted"]) || !(bool)dataRow["Mounted"]) ? Strings.StatusDismounted : Strings.StatusMounted); if (!DBNull.Value.Equals(dataRow["DeletedItemRetention"])) { dataRow["DeletedItemRetention"] = ((EnhancedTimeSpan)dataRow["DeletedItemRetention"]).Days.ToString(); } if (!DBNull.Value.Equals(dataRow["MailboxRetention"])) { dataRow["MailboxRetention"] = ((EnhancedTimeSpan)dataRow["MailboxRetention"]).Days.ToString(); } MailboxDatabase mailboxDatabase = store.GetDataObject("MailboxDatabase") as MailboxDatabase; if (mailboxDatabase != null) { dataRow["Servers"] = mailboxDatabase.Servers; } if (!DBNull.Value.Equals(dataRow["MaintenanceSchedule"])) { Schedule schedule = (Schedule)dataRow["MaintenanceSchedule"]; dataRow["MaintenanceSchedule"] = new ScheduleBuilder(schedule).GetEntireState(); } if (!DBNull.Value.Equals(dataRow["QuotaNotificationSchedule"])) { Schedule schedule2 = (Schedule)dataRow["QuotaNotificationSchedule"]; dataRow["QuotaNotificationSchedule"] = new ScheduleBuilder(schedule2).GetEntireState(); } }
public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { MailboxPropertiesHelper.GetCountryOrRegion(inputRow, dataTable, store); MailboxPropertiesHelper.GetEmailAddresses(inputRow, dataTable, store); DataRow dataRow = dataTable.Rows[0]; CalendarConfiguration calendarConfiguration = store.GetDataObject("CalendarConfiguration") as CalendarConfiguration; if (calendarConfiguration != null) { bool flag = calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept; bool flag2 = flag && !calendarConfiguration.AllBookInPolicy && calendarConfiguration.AllRequestInPolicy; bool flag3 = flag && calendarConfiguration.AllBookInPolicy && !calendarConfiguration.AllRequestInPolicy; dataRow["AutomateProcessingManual"] = flag2; dataRow["AutomateProcessingAuto"] = flag3; dataRow["AutomateProcessingCustomized"] = (!flag2 && !flag3); dataRow["AdditionalResponse"] = (calendarConfiguration.AddAdditionalResponse ? calendarConfiguration.AdditionalResponse : string.Empty); } MailboxPropertiesHelper.UpdateCanSetABP(dataRow, store); }
public static void GetSuggestionPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { MailboxPropertiesHelper.FilterNoSmtpEmailAddresses(inputRow, dataTable, store); }
public static void MailFlowSettingsPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { MailboxPropertiesHelper.GetMaxSendReceiveSize(inputRow, dataTable, store); MailboxPropertiesHelper.GetAcceptRejectSendersOrMembers(inputRow, dataTable, store); }
public static void FilterFullAccessPermission(DataRow inputRow, DataTable dataTable, DataObjectStore store) { MailboxPropertiesHelper.FilterFullAccessPermission(inputRow, dataTable, store); }
public static void SetObjectPreAction(DataRow inputRow, DataTable table, DataObjectStore store) { MailboxPropertiesHelper.SetMaxSendReceiveSize(inputRow, table, store); }
public static void GetRecipientPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { RemoteMailboxPropertiesHelper.GetObjectPostAction(inputRow, dataTable, store); MailboxPropertiesHelper.GetRecipientPostAction(inputRow, dataTable, store); }
public static void SetMailboxPermissionPreAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { MailboxPropertiesHelper.SetMailboxPermissionPreAction(inputRow, dataTable, store); }
public static void FilterCloudSendAsPermission(DataRow inputRow, DataTable dataTable, DataObjectStore store) { dataTable.Rows[0]["SendAsPermissions"] = MailboxPropertiesHelper.FindRecipientsWithSendAsPermissionCloud(store.GetDataObject("RecipientPermission") as IEnumerable <object>); }