public static void ClearOutputForOlderVersion(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            HybridConfiguration            hybridConfiguration            = store.GetDataObject("HybridConfiguration") as HybridConfiguration;
            IntraOrganizationConfiguration intraOrganizationConfiguration = store.GetDataObject("IntraOrganizationConfiguration") as IntraOrganizationConfiguration;
            bool flag = hybridConfiguration != null && DDIHelper.IsLegacyObject(hybridConfiguration);

            if (flag)
            {
                dataTable.Rows.Clear();
                store.UpdateDataObject("HybridConfiguration", null);
                DataRow row = dataTable.NewRow();
                dataTable.Rows.Add(row);
            }
            dataTable.Rows[0]["NeedUpgrade"] = flag;
            if (object.Equals(dataTable.Rows[0]["IncomingServiceInstance"], "1"))
            {
                inputRow["IsGallatin"] = (dataTable.Rows[0]["IsGallatin"] = true);
                if (OrganizationCache.RestrictIOCToSP1OrGreaterGallatin && intraOrganizationConfiguration.DeploymentIsCompleteIOCReady == false)
                {
                    dataTable.Rows[0]["GallatinBlock"] = true;
                    return;
                }
            }
            else if (!OrganizationCache.RestrictIOCToSP1OrGreaterWorldWide || intraOrganizationConfiguration.DeploymentIsCompleteIOCReady == true)
            {
                dataTable.Rows[0]["WWoAuth"] = true;
            }
        }
        public static void GetDomainOptions(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            List <string> cloudDomainNames = null;
            string        text             = inputRow["CloudDomains"] as string;

            if (text != null)
            {
                cloudDomainNames = (from cloudDomain in text.Split(new char[]
                {
                    ','
                })
                                    select cloudDomain.Trim()).ToList <string>();
            }
            IEnumerable <object> source     = store.GetDataObject("AcceptedDomain") as IEnumerable <object>;
            IEnumerable <object> enumerable = from domain in source
                                              where HybridConfigurationWizardServiceCodeBehind.IsSelectableDomain((Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomain)domain, cloudDomainNames)
                                              select((Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomain)domain).DomainName.SmtpDomain;
            int num = enumerable.Count <object>();

            if (num != 0)
            {
                inputRow["DomainOptions"] = (dataTable.Rows[0]["DomainOptions"] = enumerable);
            }
            if (num == 1)
            {
                store.SetModifiedColumns(new List <string>
                {
                    "Domains"
                });
                inputRow["Domains"] = (dataTable.Rows[0]["Domains"] = enumerable.First <object>().ToString());
            }
        }
Пример #3
0
        private bool?CheckRbacForNotAccessPermission(DataRow input, DataTable dataTable, DataObjectStore store, Variable variable, IEnumerable <Workflow> sets)
        {
            bool?flag = null;
            Collection <Activity> activities = base.Activities;
            bool hasDataObject = !string.IsNullOrWhiteSpace(variable.DataObjectName);

            foreach (Activity activity in activities)
            {
                flag = flag.Or(activity.FindAndCheckPermission((Activity a) => (hasDataObject && a is GetCmdlet && (a as GetCmdlet).DataObjectName == variable.DataObjectName) || a.HasOutputVariable(variable.Name), input, dataTable, store, variable));
                if (flag.IsTrue())
                {
                    break;
                }
            }
            if (hasDataObject)
            {
                IVersionable versionable = store.GetDataObject(variable.DataObjectName) as IVersionable;
                if (versionable != null && versionable.ExchangeVersion != null)
                {
                    PropertyDefinition propertyDefinition = versionable.ObjectSchema[variable.MappingProperty];
                    if (propertyDefinition != null && !versionable.IsPropertyAccessible(propertyDefinition))
                    {
                        flag = new bool?(false);
                    }
                }
            }
            return(flag);
        }
Пример #4
0
        public static void ExtractTenantDomainInfo(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            IEnumerable <object> enumerable = store.GetDataObject("AcceptedDomain") as IEnumerable <object>;
            List <string>        list       = new List <string>();
            bool flag = false;

            if (enumerable != null)
            {
                foreach (object obj in enumerable)
                {
                    AcceptedDomain acceptedDomain = (AcceptedDomain)obj;
                    if (!flag && acceptedDomain.IsCoexistenceDomain)
                    {
                        flag = true;
                    }
                    if (!acceptedDomain.IsCoexistenceDomain && acceptedDomain.DomainName.SmtpDomain != null)
                    {
                        list.Add(acceptedDomain.DomainName.SmtpDomain.ToString());
                    }
                }
            }
            DataRow dataRow = dataTable.NewRow();

            dataRow["HasCoexistenceDomain"] = flag;
            dataRow["DomainNames"]          = string.Join(",", list.ToArray());
            dataTable.Rows.Add(dataRow);
        }
Пример #5
0
        public static void ExtractAccountNamespaceAndSharingDomains(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            if (store.GetDataObject("FederatedOrganizationIdentifier") == null)
            {
                return;
            }
            FederatedOrganizationIdWithDomainStatus federatedOrganizationIdWithDomainStatus = (FederatedOrganizationIdWithDomainStatus)store.GetDataObject("FederatedOrganizationIdentifier");
            SmtpDomain smtpDomain = (federatedOrganizationIdWithDomainStatus.AccountNamespace == null) ? null : new SmtpDomain(FederatedOrganizationId.RemoveHybridConfigurationWellKnownSubDomain(federatedOrganizationIdWithDomainStatus.AccountNamespace.Domain));
            MultiValuedProperty <FederatedDomain> domains = federatedOrganizationIdWithDomainStatus.Domains;

            dataTable.Rows[0]["HasAccountNamespace"] = false;
            dataTable.Rows[0]["HasFederatedDomains"] = false;
            if (smtpDomain != null)
            {
                List <object> list = new List <object>();
                dataTable.Rows[0]["HasAccountNamespace"] = true;
                dataTable.Rows[0]["Name"] = federatedOrganizationIdWithDomainStatus.AccountNamespace.Domain;
                foreach (FederatedDomain federatedDomain in domains)
                {
                    if (federatedDomain.Domain.Domain.Equals(smtpDomain.Domain, StringComparison.InvariantCultureIgnoreCase))
                    {
                        dataTable.Rows[0]["AccountNamespace"] = (SharingDomain)federatedDomain;
                    }
                    else
                    {
                        list.Add((SharingDomain)federatedDomain);
                    }
                }
                if (list.Count > 0)
                {
                    dataTable.Rows[0]["SharingEnabledDomains"] = list;
                    dataTable.Rows[0]["HasFederatedDomains"]   = true;
                }
            }
        }
Пример #6
0
 public static void SetIfFederatedDisable(DataRow row, DataTable dataTable, DataObjectStore store)
 {
     if (!Datacenter.IsMultiTenancyEnabled() && store.GetDataObject("FederationTrust") == null)
     {
         dataTable.Rows[0]["FederationDisabled"] = true;
     }
 }
        public static void GenerateName(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            ReducedRecipient reducedRecipient = store.GetDataObject("ReducedRecipient") as ReducedRecipient;
            string           text             = (string)inputRow["DisplayName"];

            if (reducedRecipient != null)
            {
                string text2 = " " + Guid.NewGuid().ToString("B").ToUpperInvariant();
                if (text.Length > 64)
                {
                    text = text.SurrogateSubstring(0, text.Length - text2.Length);
                }
                inputRow["Name"] = text + text2;
            }
            else
            {
                if (text.Length > 64)
                {
                    text = text.SurrogateSubstring(0, 64);
                }
                inputRow["Name"] = text;
            }
            store.SetModifiedColumns(new List <string>
            {
                "Name"
            });
        }
Пример #8
0
 public static void SetIfFederatedPartialDisable(DataRow row, DataTable dataTable, DataObjectStore store)
 {
     if (store.GetDataObject("FederatedOrganizationIdentifier") != null && !(bool)store.GetValue("FederatedOrganizationIdentifier", "Enabled") && store.GetValue("FederatedOrganizationIdentifier", "AccountNamespace") != null)
     {
         dataTable.Rows[0]["FederationDisabled"]        = true;
         dataTable.Rows[0]["FederationPartialDisabled"] = true;
     }
 }
Пример #9
0
        public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            SharingPolicy sharingPolicy = store.GetDataObject("SharingPolicy") as SharingPolicy;

            if (dataTable.Rows.Count == 1 && sharingPolicy != null)
            {
                SharingPolicyAssistor.UpdateFormattedNameAndDomains(dataTable.Rows[0]);
            }
        }
Пример #10
0
        public static void GetAutoDiscoverVirtualDirectoryPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow            row = dataTable.Rows[0];
            ClientAccessServer clientAccessServer = (ClientAccessServer)store.GetDataObject("ClientAccessServer");

            if (clientAccessServer != null && clientAccessServer.AutoDiscoverServiceInternalUri != null)
            {
                CertificateHelper.GetOneItem(row, "AutoInternalDomain", clientAccessServer.AutoDiscoverServiceInternalUri.Host);
            }
        }
Пример #11
0
        private static void UpdateConfigDomain(DataTable dataTable, DataObjectStore store, string cfgName)
        {
            DataRow row = dataTable.Rows[0];
            PopImapAdConfiguration popImapAdConfiguration = (PopImapAdConfiguration)store.GetDataObject(cfgName + "Configuration");

            if (popImapAdConfiguration != null && !string.IsNullOrEmpty(popImapAdConfiguration.X509CertificateName))
            {
                CertificateHelper.GetOneItem(row, cfgName + "Domain", popImapAdConfiguration.X509CertificateName);
            }
        }
Пример #12
0
        public static void SetHybridConfigurationEnabled(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            HybridConfiguration hybridConfiguration = store.GetDataObject("HybridConfiguration") as HybridConfiguration;
            bool flag = hybridConfiguration != null && !DDIHelper.IsLegacyObject(hybridConfiguration);

            dataTable.Rows[0]["HybridConfigurationEnabled"] = flag;
            if (flag)
            {
                dataTable.Rows[0]["IsHostedOnGallatin"] = (hybridConfiguration.ServiceInstance == 1);
            }
        }
Пример #13
0
        private static bool FindServerToSwichover(DataRow inputRow, DataRow row, DataObjectStore store)
        {
            if (store.GetDataObject("MailboxDatabaseWholeObject") == null)
            {
                return(false);
            }
            HashSet <Guid> hashSet = null;

            if (DBNull.Value.Equals(inputRow["ServerSetForSwitchoverPicker"]))
            {
                hashSet = new HashSet <Guid>();
                new Dictionary <Guid, int>();
                IEnumerable <object> enumerable = store.GetDataObject("MailboxDatabaseWholeObject") as IEnumerable <object>;
                if (enumerable != null)
                {
                    foreach (object obj in enumerable)
                    {
                        MailboxDatabase mailboxDatabase = obj as MailboxDatabase;
                        foreach (ADObjectId adobjectId in mailboxDatabase.Servers)
                        {
                            if (!hashSet.Contains(adobjectId.ObjectGuid))
                            {
                                hashSet.Add(adobjectId.ObjectGuid);
                            }
                        }
                    }
                }
                inputRow["ServerSetForSwitchoverPicker"] = hashSet;
            }
            else
            {
                hashSet = (inputRow["ServerSetForSwitchoverPicker"] as HashSet <Guid>);
            }
            if (hashSet != null && hashSet.Count > 0)
            {
                ADObjectId adobjectId2 = row["Identity"] as ADObjectId;
                string     value       = (string)inputRow["CurrentServer"];
                return(adobjectId2 != null && hashSet.Contains(adobjectId2.ObjectGuid) && !adobjectId2.ObjectGuid.ToString().Equals(value, StringComparison.OrdinalIgnoreCase));
            }
            return(false);
        }
Пример #14
0
        public static void GetObjectPostAction(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            DataRow dataRow = table.Rows[0];

            dataRow["ExDTNotAfter"] = ((ExDateTime)((DateTime)dataRow["NotAfter"])).ToShortDateString();
            ExchangeCertificate exchangeCertificate = (ExchangeCertificate)store.GetDataObject("ExchangeCertificate");

            if (exchangeCertificate != null)
            {
                dataRow["SubjectName"] = exchangeCertificate.SubjectName.Name;
            }
        }
Пример #15
0
        private static bool FindServerInSameDagButDontHaveTheDatabase(DataRow inputRow, DataRow row, DataObjectStore store)
        {
            if (DBNull.Value.Equals(row["DatabaseAvailabilityGroup"]))
            {
                return(false);
            }
            MailboxDatabase mailboxDatabase = (MailboxDatabase)store.GetDataObject("MailboxDatabase");
            string          b          = (string)row["DatabaseAvailabilityGroup"];
            string          serverName = (string)row["Name"];

            return(mailboxDatabase.MasterServerOrAvailabilityGroup.Name == b && !mailboxDatabase.Servers.Any((ADObjectId x) => serverName.Equals(x.Name, StringComparison.OrdinalIgnoreCase)));
        }
        public static void OnPostGetObjectForNew(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            if (dataTable.Rows.Count == 0)
            {
                return;
            }
            DataRow    dataRow    = dataTable.Rows[0];
            UMDialPlan umdialPlan = (UMDialPlan)store.GetDataObject("UMDialPlan");

            dataRow["UMDialPlan"]      = umdialPlan.Name;
            dataRow["ExtensionLength"] = umdialPlan.NumberOfDigitsInExtension;
            dataRow["IsTelex"]         = (umdialPlan.URIType == UMUriType.TelExtn);
        }
        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);
            }
        }
Пример #18
0
        public static void GenerateAddAndRemoveCollection(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            if (store.GetDataObject("FederatedOrganizationIdentifier") == null)
            {
                return;
            }
            List <object> list = new List <object>();

            if (dataTable.Rows[0]["SharingEnabledDomains"] != DBNull.Value)
            {
                foreach (object obj in ((IEnumerable)dataTable.Rows[0]["SharingEnabledDomains"]))
                {
                    SharingDomain sharingDomain = (SharingDomain)obj;
                    list.Add((SmtpDomain)sharingDomain);
                }
            }
            FederatedOrganizationIdWithDomainStatus federatedOrganizationIdWithDomainStatus = (FederatedOrganizationIdWithDomainStatus)store.GetDataObject("FederatedOrganizationIdentifier");
            SmtpDomain smtpDomain = (federatedOrganizationIdWithDomainStatus.AccountNamespace == null) ? null : new SmtpDomain(FederatedOrganizationId.RemoveHybridConfigurationWellKnownSubDomain(federatedOrganizationIdWithDomainStatus.AccountNamespace.Domain));

            if (smtpDomain == null && dataTable.Rows[0]["AccountNamespace"] != DBNull.Value)
            {
                smtpDomain = (SmtpDomain)((SharingDomain)dataTable.Rows[0]["AccountNamespace"]);
            }
            if (smtpDomain != null)
            {
                list.Remove(smtpDomain);
            }
            MultiValuedProperty <FederatedDomain> multiValuedProperty = (MultiValuedProperty <FederatedDomain>)store.GetValue("FederatedOrganizationIdentifier", "Domains");
            List <object> list2 = new List <object>();

            if (multiValuedProperty != null)
            {
                foreach (FederatedDomain federatedDomain in multiValuedProperty)
                {
                    if (!federatedDomain.Domain.Domain.Equals(smtpDomain.Domain, StringComparison.InvariantCultureIgnoreCase))
                    {
                        SmtpDomain item = new SmtpDomain(federatedDomain.Domain.Domain);
                        if (list.Contains(item))
                        {
                            list.Remove(item);
                        }
                        else
                        {
                            list2.Add(item);
                        }
                    }
                }
            }
            dataTable.Rows[0]["AddedSharingEnabledDomains"]   = list;
            dataTable.Rows[0]["RemovedSharingEnabledDomains"] = list2;
        }
Пример #19
0
        public static void GetSDOPostAction(DataRow input, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];
            CalendarConfiguration calendarConfiguration = store.GetDataObject("CalendarConfiguration") as CalendarConfiguration;

            if (calendarConfiguration != null)
            {
                dataRow["ResourceDelegates"]      = calendarConfiguration.ResourceDelegates.ResolveRecipientsForSDO(3, (RecipientObjectResolverRow x) => Strings.DisplayedResourceDelegates(x.DisplayName, x.PrimarySmtpAddress));
                dataRow["AutomateProcessingAuto"] = (calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept && calendarConfiguration.AllBookInPolicy && !calendarConfiguration.AllRequestInPolicy);
            }
            RecipientTypeDetails recipientTypeDetails = (RecipientTypeDetails)dataRow["RecipientTypeDetails"];

            dataRow["IsRoom"] = (recipientTypeDetails == RecipientTypeDetails.RoomMailbox);
        }
Пример #20
0
        private static bool FindServerInSameDatabaseButNotCurrentServer(DataRow inputRow, DataRow row, DataObjectStore store)
        {
            if (DBNull.Value.Equals(row["DatabaseAvailabilityGroup"]))
            {
                return(false);
            }
            MailboxDatabase mailboxDatabase = (MailboxDatabase)store.GetDataObject("MailboxDatabase");
            string          b               = (string)row["DatabaseAvailabilityGroup"];
            string          text            = (string)row["Name"];
            ADObjectId      currentServerId = (ADObjectId)row["Identity"];
            string          value           = (string)inputRow["CurrentServer"];

            return(mailboxDatabase.MasterServerOrAvailabilityGroup.Name == b && mailboxDatabase.Servers.Any((ADObjectId serverId) => serverId.Equals(currentServerId)) && !text.Equals(value, StringComparison.OrdinalIgnoreCase));
        }
Пример #21
0
        private static void UpdateServiceDomain(DataTable dataTable, DataObjectStore store, string serviceName)
        {
            DataRow            row = dataTable.Rows[0];
            ADVirtualDirectory advirtualDirectory = (ADVirtualDirectory)store.GetDataObject(serviceName + "VirtualDirectory");

            if (advirtualDirectory != null && advirtualDirectory.ExternalUrl != null)
            {
                CertificateHelper.GetOneItem(row, serviceName + "ExternalDomain", advirtualDirectory.ExternalUrl.Host);
            }
            if (advirtualDirectory != null && advirtualDirectory.InternalUrl != null)
            {
                CertificateHelper.GetOneItem(row, serviceName + "InternalDomain", advirtualDirectory.InternalUrl.Host);
            }
        }
Пример #22
0
        public static void TeamMailboxDiagnosticsPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            TeamMailboxDiagnosticsInfo teamMailboxDiagnosticsInfo = store.GetDataObject("TeamMailboxDiagnosticsInfo") as TeamMailboxDiagnosticsInfo;

            if (dataTable.Rows.Count == 1 && teamMailboxDiagnosticsInfo != null)
            {
                if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.NotAvailable)
                {
                    dataTable.Rows[0]["DocumentSyncStatus"]    = OwaOptionClientStrings.TeamMailboxSyncNotAvailable;
                    dataTable.Rows[0]["MembershipSyncStatus"]  = OwaOptionClientStrings.TeamMailboxSyncNotAvailable;
                    dataTable.Rows[0]["MaintenanceSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncNotAvailable;
                }
                else
                {
                    dataTable.Rows[0]["DocumentSyncStatus"]    = ((teamMailboxDiagnosticsInfo.HierarchySyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess);
                    dataTable.Rows[0]["MembershipSyncStatus"]  = ((teamMailboxDiagnosticsInfo.MembershipSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess);
                    dataTable.Rows[0]["MaintenanceSyncStatus"] = ((teamMailboxDiagnosticsInfo.MaintenanceSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess);
                }
                if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMembershipSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMaintenanceSyncFailure)
                {
                    dataTable.Rows[0]["DocumentSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError;
                }
                if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMembershipSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipAndMaintenanceSyncFailure)
                {
                    dataTable.Rows[0]["MembershipSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError;
                }
                if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MaintenanceSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipAndMaintenanceSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMaintenanceSyncFailure)
                {
                    dataTable.Rows[0]["MaintenanceSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError;
                }
                dataTable.Rows[0]["MembershipSyncDate"]                = ((teamMailboxDiagnosticsInfo.MembershipSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.MembershipSyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString());
                dataTable.Rows[0]["MaintenanceSyncDate"]               = ((teamMailboxDiagnosticsInfo.MaintenanceSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.MaintenanceSyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString());
                dataTable.Rows[0]["DocumentSyncDate"]                  = ((teamMailboxDiagnosticsInfo.HierarchySyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.HierarchySyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString());
                dataTable.Rows[0]["SynchronizationDetails"]            = teamMailboxDiagnosticsInfo.ToString();
                dataTable.Rows[0]["MembershipSyncStatus"]              = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["MembershipSyncStatus"];
                dataTable.Rows[0]["MembershipSyncDate"]                = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["MembershipSyncDate"];
                dataTable.Rows[0]["MaintenanceSyncStatus"]             = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["MaintenanceSyncStatus"];
                dataTable.Rows[0]["MaintenanceSyncDate"]               = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["MaintenanceSyncDate"];
                dataTable.Rows[0]["DocumentSyncStatus"]                = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["DocumentSyncStatus"];
                dataTable.Rows[0]["DocumentSyncDate"]                  = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["DocumentSyncDate"];
                dataTable.Rows[0]["TeamMailboxMembershipString1"]      = OwaOptionClientStrings.TeamMailboxMembershipString1;
                dataTable.Rows[0]["TeamMailboxMembershipString2"]      = OwaOptionClientStrings.TeamMailboxMembershipString2;
                dataTable.Rows[0]["TeamMailboxMembershipString3"]      = OwaOptionClientStrings.TeamMailboxMembershipString3;
                dataTable.Rows[0]["TeamMailboxMembershipString4"]      = OwaOptionClientStrings.TeamMailboxMembershipString4;
                dataTable.Rows[0]["TeamMailboxStartedMembershipSync"]  = OwaOptionClientStrings.TeamMailboxStartedMembershipSync;
                dataTable.Rows[0]["TeamMailboxStartedMaintenanceSync"] = OwaOptionClientStrings.TeamMailboxStartedMaintenanceSync;
                dataTable.Rows[0]["TeamMailboxStartedDocumentSync"]    = OwaOptionClientStrings.TeamMailboxStartedDocumentSync;
            }
        }
Пример #23
0
        public static void GetPublicFolderClientPermissionEntryPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            IEnumerable <object> enumerable        = store.GetDataObject("MailboxFolderPermissions") as IEnumerable <object>;
            List <PublicFolderPermissionInfo> list = new List <PublicFolderPermissionInfo>();

            foreach (object obj in enumerable)
            {
                MailboxFolderPermission mailboxFolderPermission = obj as MailboxFolderPermission;
                if (mailboxFolderPermission != null && mailboxFolderPermission.User.UserType != MailboxFolderUserId.MailboxFolderUserType.Anonymous && mailboxFolderPermission.User.UserType != MailboxFolderUserId.MailboxFolderUserType.Default)
                {
                    list.Add((PublicFolderPermissionInfo)mailboxFolderPermission);
                }
            }
            dataTable.Rows[0]["FolderPermissions"] = list;
        }
Пример #24
0
        public static void PrepareDBCopyForSDO(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DatabaseCopyStatusEntry statusEntry        = (DatabaseCopyStatusEntry)store.GetDataObject("DatabaseCopyStatusEntry");
            DatabaseCopyStatus      databaseCopyStatus = new DatabaseCopyStatus(statusEntry);
            DataRow dataRow = dataTable.Rows[0];

            dataRow["CanActivate"]             = databaseCopyStatus.CanActivate;
            dataRow["CanRemove"]               = databaseCopyStatus.CanRemove;
            dataRow["CanResume"]               = databaseCopyStatus.CanResume;
            dataRow["CanSuspend"]              = databaseCopyStatus.CanSuspend;
            dataRow["CanUpdate"]               = databaseCopyStatus.CanUpdate;
            dataRow["ContentIndexStateString"] = databaseCopyStatus.ContentIndexStateString;
            dataRow["IsActive"]     = databaseCopyStatus.IsActive;
            dataRow["StatusString"] = databaseCopyStatus.StatusString;
        }
Пример #25
0
        public static void ExtractPendingAccountNamespaceAndSharingDomains(DataRow row, DataTable dataTable, DataObjectStore store)
        {
            if (store.GetDataObject("PendingFederatedDomain") == null)
            {
                return;
            }
            PendingFederatedDomain pendingFederatedDomain  = store.GetDataObject("PendingFederatedDomain") as PendingFederatedDomain;
            SmtpDomain             pendingAccountNamespace = pendingFederatedDomain.PendingAccountNamespace;

            SmtpDomain[] pendingDomains = pendingFederatedDomain.PendingDomains;
            if (dataTable.Rows[0]["HasAccountNamespace"] != DBNull.Value && !(bool)dataTable.Rows[0]["HasAccountNamespace"] && pendingAccountNamespace != null)
            {
                dataTable.Rows[0]["AccountNamespace"] = (SharingDomain)pendingAccountNamespace;
            }
            List <object> list = new List <object>();

            if (dataTable.Rows[0]["SharingEnabledDomains"] != DBNull.Value)
            {
                foreach (object item in ((IEnumerable)dataTable.Rows[0]["SharingEnabledDomains"]))
                {
                    list.Add(item);
                }
            }
            foreach (SmtpDomain smtpDomain in pendingDomains)
            {
                if (!list.Contains((SharingDomain)smtpDomain))
                {
                    list.Add((SharingDomain)smtpDomain);
                }
            }
            if (list.Count > 0)
            {
                dataTable.Rows[0]["SharingEnabledDomains"] = list;
                dataTable.Rows[0]["HasFederatedDomains"]   = true;
            }
        }
        public static void MailboxUsageGetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];
            Mailbox mailbox = store.GetDataObject("Mailbox") as Mailbox;

            if (mailbox != null)
            {
                MailboxStatistics mailboxStatistics = store.GetDataObject("MailboxStatistics") as MailboxStatistics;
                MailboxDatabase   mailboxDatabase   = store.GetDataObject("MailboxDatabase") as MailboxDatabase;
                MailboxStatistics archiveStatistics = store.GetDataObject("ArchiveStatistics") as MailboxStatistics;
                MailboxPropertiesHelper.MailboxUsage mailboxUsage = new MailboxPropertiesHelper.MailboxUsage(mailbox, mailboxDatabase, mailboxStatistics, archiveStatistics);
                dataRow["MailboxUsage"] = new StatisticsBarData(mailboxUsage.MailboxUsagePercentage, mailboxUsage.MailboxUsageState, mailboxUsage.MailboxUsageText);
                if ((mailbox.UseDatabaseQuotaDefaults != null && mailbox.UseDatabaseQuotaDefaults.Value && mailboxDatabase != null && !Util.IsDataCenter) || !mailbox.ProhibitSendQuota.IsUnlimited)
                {
                    dataRow["IsMailboxUsageUnlimited"] = false;
                }
                else
                {
                    dataRow["IsMailboxUsageUnlimited"] = true;
                }
                Unlimited <ByteQuantifiedSize> maxReceiveSize = mailbox.MaxReceiveSize;
                if (maxReceiveSize.IsUnlimited)
                {
                    dataRow["MaxReceiveSize"] = "unlimited";
                }
                else
                {
                    dataRow["MaxReceiveSize"] = PublicFolderMailboxService.UnlimitedByteQuantifiedSizeToString(maxReceiveSize);
                }
                dataRow["IssueWarningQuota"]             = PublicFolderMailboxService.UnlimitedByteQuantifiedSizeToString(mailboxUsage.IssueWarningQuota);
                dataRow["ProhibitSendQuota"]             = PublicFolderMailboxService.UnlimitedByteQuantifiedSizeToString(mailboxUsage.ProhibitSendQuota);
                dataRow["ProhibitSendReceiveQuota"]      = PublicFolderMailboxService.UnlimitedByteQuantifiedSizeToString(mailboxUsage.ProhibitSendReceiveQuota);
                dataRow["RetainDeletedItemsFor"]         = mailboxUsage.RetainDeletedItemsFor.Days.ToString();
                dataRow["RetainDeletedItemsUntilBackup"] = mailboxUsage.RetainDeletedItemsUntilBackup;
            }
        }
        public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            OrganizationRelationship organizationRelationship = store.GetDataObject("OrganizationRelationship") as OrganizationRelationship;

            if (organizationRelationship != null && dataTable.Rows.Count == 1)
            {
                DataRow dataRow = dataTable.Rows[0];
                if (organizationRelationship.FreeBusyAccessLevel == FreeBusyAccessLevel.None)
                {
                    dataRow["FreeBusyAccessEnabled"] = false;
                    dataRow["FreeBusyAccessLevel"]   = FreeBusyAccessLevel.AvailabilityOnly;
                }
                dataRow["DomainNames"]          = OrganizationRelationshipAssistor.ToStringMVP(organizationRelationship.DomainNames);
                dataRow["FormattedDomainNames"] = DDIHelper.JoinList <SmtpDomain>(organizationRelationship.DomainNames, (SmtpDomain domain) => domain.Domain);
            }
        }
Пример #28
0
        public static void GetAutoDiscoverAcceptDomainPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow row        = dataTable.Rows[0];
            object  dataObject = store.GetDataObject("AcceptedDomainWholeObject");

            if (dataObject != null && dataObject is IEnumerable)
            {
                foreach (object obj in (dataObject as IEnumerable))
                {
                    Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomain acceptedDomain = obj as Microsoft.Exchange.Data.Directory.SystemConfiguration.AcceptedDomain;
                    if (acceptedDomain != null)
                    {
                        CertificateHelper.GetOneItem(row, "AutoExternalDomain", "AutoDiscover." + acceptedDomain.DomainName.Domain);
                    }
                }
            }
        }
Пример #29
0
        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();
            }
        }
Пример #30
0
        public static void OnPostExportSelfSignedCertificate(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow    = dataTable.Rows[0];
            object  dataObject = store.GetDataObject("BinaryFileDataObject");

            if (dataObject != null && dataObject is IEnumerable)
            {
                foreach (object obj in ((IEnumerable)dataObject))
                {
                    BinaryFileDataObject binaryFileDataObject = (BinaryFileDataObject)obj;
                    if (binaryFileDataObject != null)
                    {
                        dataRow["FileData"] = binaryFileDataObject.FileData;
                        break;
                    }
                }
            }
        }