public static void GetFFOMailUserSDO(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            GetRecipientCmdlet getRecipientCmdlet = new GetRecipientCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getRecipientCmdlet.Authenticator  = PswsAuthenticator.Create();
            getRecipientCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            Recipient[] array = getRecipientCmdlet.Run();
            if (array == null || array.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            Recipient recipient = array.First <Recipient>();
            DataRow   dataRow   = table.Rows[0];

            dataRow["Identity"]           = new Identity(recipient.Guid.ToString());
            dataRow["DisplayName"]        = recipient.DisplayName;
            dataRow["Alias"]              = recipient.Alias;
            dataRow["PrimarySmtpAddress"] = recipient.PrimarySmtpAddress;
            dataRow["Name"]       = recipient.Name;
            dataRow["FirstName"]  = recipient.FirstName;
            dataRow["LastName"]   = recipient.LastName;
            dataRow["Title"]      = recipient.Title;
            dataRow["Department"] = recipient.Department;
            dataRow["Office"]     = recipient.Office;
            dataRow["Phone"]      = recipient.Phone;
        }
 public static void GetFFOMailUserList(DataRow inputRow, DataTable table, DataObjectStore store)
 {
     try
     {
         table.BeginLoadData();
         GetRecipientCmdlet getRecipientCmdlet = new GetRecipientCmdlet
         {
             Filter     = inputRow["SearchText"].ToString().ToRecipeintFilterString("((RecipientTypeDetails -eq 'UserMailbox') -or (RecipientTypeDetails -eq 'MailUser'))"),
             Properties = "Identity,DisplayName,PrimarySmtpAddress,RecipientTypeDetails"
         };
         getRecipientCmdlet.Authenticator  = PswsAuthenticator.Create();
         getRecipientCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
         foreach (Recipient recipient in getRecipientCmdlet.Run())
         {
             DataRow dataRow = table.NewRow();
             dataRow["Identity"]             = new Identity(recipient.Guid.ToString());
             dataRow["DisplayName"]          = recipient.DisplayName;
             dataRow["PrimarySmtpAddress"]   = recipient.PrimarySmtpAddress;
             dataRow["RecipientTypeDetails"] = FFOMailUser.GenerateUserTypeText(Enum.Parse(typeof(RecipientTypeDetails), recipient.RecipientTypeDetails, true));
             table.Rows.Add(dataRow);
         }
     }
     finally
     {
         table.EndLoadData();
     }
 }
        public static void NewFFOMailUser(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            NewMailUserCmdlet newMailUserCmdlet = new NewMailUserCmdlet();

            newMailUserCmdlet.Authenticator  = PswsAuthenticator.Create();
            newMailUserCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            if (!string.IsNullOrEmpty(inputRow["FirstName"].ToString()))
            {
                newMailUserCmdlet.FirstName = inputRow["FirstName"].ToString();
            }
            if (!string.IsNullOrEmpty(inputRow["Initials"].ToString()))
            {
                newMailUserCmdlet.Initials = inputRow["Initials"].ToString();
            }
            if (!string.IsNullOrEmpty(inputRow["LastName"].ToString()))
            {
                newMailUserCmdlet.LastName = inputRow["LastName"].ToString();
            }
            if (!string.IsNullOrEmpty(inputRow["ExternalEmailAddress"].ToString()))
            {
                newMailUserCmdlet.ExternalEmailAddress = inputRow["ExternalEmailAddress"].ToString();
            }
            newMailUserCmdlet.Alias                     = inputRow["Alias"].ToString();
            newMailUserCmdlet.DisplayName               = inputRow["MailUserDisplayName"].ToString();
            newMailUserCmdlet.Name                      = inputRow["MailUserDisplayName"].ToString();
            newMailUserCmdlet.Password                  = inputRow["PlainPassword"].ToString();
            newMailUserCmdlet.PrimarySmtpAddress        = inputRow["PrimarySmtpAddress"].ToString();
            newMailUserCmdlet.MicrosoftOnlineServicesID = inputRow["MicrosoftOnlineServicesID"].ToString();
            newMailUserCmdlet.Run();
            if (!string.IsNullOrEmpty(newMailUserCmdlet.Error))
            {
                throw new Exception(newMailUserCmdlet.Error);
            }
        }
Exemple #4
0
        // Token: 0x06001077 RID: 4215 RVA: 0x0003F1EC File Offset: 0x0003D3EC
        public void Add(string subscriptionId, string channelId, string user, NotificationType notificationType, string remoteEndpointOverride, out bool subscriptionExists)
        {
            ArgumentValidator.ThrowIfNullOrWhiteSpace("subscriptionId", subscriptionId);
            ArgumentValidator.ThrowIfNullOrWhiteSpace("channelId", channelId);
            ArgumentValidator.ThrowIfNullOrWhiteSpace("user", user);
            RemoteSubscriptionsInfo.NotificationTypeAndChannelInfo notificationTypeAndChannelInfo;
            if (!this.remoteSubscriptions.TryGetValue(subscriptionId, out notificationTypeAndChannelInfo))
            {
                notificationTypeAndChannelInfo = (this.remoteSubscriptions[subscriptionId] = new RemoteSubscriptionsInfo.NotificationTypeAndChannelInfo(notificationType));
            }
            HashSet <RemoteChannelInfo> channels          = notificationTypeAndChannelInfo.Channels;
            RemoteChannelInfo           remoteChannelInfo = new RemoteChannelInfo(channelId, user);

            if (!string.IsNullOrEmpty(remoteEndpointOverride) && AppConfigLoader.GetConfigBoolValue("Test_OwaAllowHeaderOverride", false))
            {
                remoteChannelInfo.EndpointTestOverride = remoteEndpointOverride;
            }
            subscriptionExists = !channels.Add(remoteChannelInfo);
            if (subscriptionExists)
            {
                SubscriberConcurrencyTracker.Instance.OnResubscribe(this.Mailbox, notificationType);
            }
            else
            {
                SubscriberConcurrencyTracker.Instance.OnSubscribe(this.Mailbox, notificationType);
            }
            this.AddSubscriptionToPerChannelList(channelId, subscriptionId);
        }
Exemple #5
0
        static RbacModule()
        {
            HashSet <string> hashSet = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase);
            string           configStringValue;

            if (Util.IsDataCenter)
            {
                configStringValue = AppConfigLoader.GetConfigStringValue("IframeablePagesForDataCenter", null);
            }
            else
            {
                configStringValue = AppConfigLoader.GetConfigStringValue("IframeablePagesForOnPremises", null);
            }
            if (!string.IsNullOrEmpty(configStringValue))
            {
                if (configStringValue == "*")
                {
                    RbacModule.bypassXFrameOptions = true;
                }
                else
                {
                    RbacModule.bypassXFrameOptions = false;
                    foreach (string item in configStringValue.Split(new char[]
                    {
                        ','
                    }))
                    {
                        hashSet.Add(item);
                    }
                }
            }
            RbacModule.xFrameOptionsExceptionList = hashSet;
        }
Exemple #6
0
        // Token: 0x0600144F RID: 5199 RVA: 0x00075368 File Offset: 0x00073568
        public Configuration()
        {
            bool               configBoolValue     = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionIsLoggingEnabled", true);
            LoggingLevel       configEnumValue     = AppConfigLoader.GetConfigEnumValue <LoggingLevel>("InferenceDataCollectionLoggingLevel", LoggingLevel.Debug);
            string             configStringValue   = AppConfigLoader.GetConfigStringValue("InferenceDataCollectionLogPath", Configuration.DefaultLogPath);
            TimeSpan           configTimeSpanValue = AppConfigLoader.GetConfigTimeSpanValue("InferenceDataCollectionMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0));
            ByteQuantifiedSize byteQuantifiedSize  = ConfigurationUtils.ReadByteQuantifiedSizeValue("InferenceDataCollectionMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL));
            ByteQuantifiedSize byteQuantifiedSize2 = ConfigurationUtils.ReadByteQuantifiedSizeValue("InferenceDataCollectionMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL));

            base.MetadataLogConfig                = new LogConfig(configBoolValue, "InferenceMetadata", "InferenceMetadata", Path.Combine(configStringValue, "Metadata"), new ulong?(byteQuantifiedSize.ToBytes()), new ulong?(byteQuantifiedSize2.ToBytes()), new TimeSpan?(configTimeSpanValue), 4096);
            base.DiagnosticLogConfig              = new DiagnosticLogConfig(configBoolValue, "InferenceDataCollection", "InferenceDataCollection", configStringValue, new ulong?(byteQuantifiedSize.ToBytes()), new ulong?(byteQuantifiedSize2.ToBytes()), new TimeSpan?(configTimeSpanValue), configEnumValue);
            base.MailboxReprocessAge              = AppConfigLoader.GetConfigTimeSpanValue("InferenceDataCollectionMailboxReprocessAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0));
            base.ModuloNumberToRandomize          = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionModuloNumberToRandomize", 1, int.MaxValue, 500);
            this.ModuloNumberToRandomizeForGroups = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionModuloNumberToRandomizeForGroups", 1, int.MaxValue, 10);
            base.BlackListedFolders               = ConfigurationUtils.ReadCommaSeperatedStringValue("InferenceDataCollectionBlackListedFolders", null);
            base.WhiteListedFolders               = ConfigurationUtils.ReadCommaSeperatedStringValue("InferenceDataCollectionWhiteListedFolders", null);
            base.MinimumItemCountInMailbox        = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumItemCountInMailbox", 0, int.MaxValue, 0);
            base.MinimumSentItemsCount            = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumSentItemsCount", 0, int.MaxValue, 0);
            base.NumberOfItemsPerFolderToProcess  = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionNumberOfItemsPerFolderToProcess", 0, int.MaxValue, int.MaxValue);
            base.MinimumSentItemsPercentage       = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumSentItemsPercentage", 0, 100, 0);
            base.IsOutputSanitized                = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionIsOutputSanitized", true);
            base.QueryPageSize           = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionQueryPageSize", 0, 32767, 100);
            base.CollectMessageBodyProps = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionCollectMessageBodyProps", false);
            base.ChunkSize           = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionChunkSize", 1, int.MaxValue, 1000);
            base.ItemMaxAttemptCount = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionItemMaxAttemptCount", 1, 10, 3);
        }
Exemple #7
0
 // Token: 0x06001D50 RID: 7504 RVA: 0x00074AA8 File Offset: 0x00072CA8
 public SpeechRecognitionProcessor(HttpContext httpContext)
 {
     this.speechScenario = SpeechRecognitionProcessor.CreateSpeechRecognitionScenario(httpContext, out this.budget);
     this.HttpContext    = httpContext;
     this.parameters     = this.speechScenario.Parameters;
     this.userContext    = this.speechScenario.UserContext;
     this.maxAudioSize   = AppConfigLoader.GetConfigIntValue("SpeechRecognitionMaxAudioSize", 0, int.MaxValue, 32500);
 }
 public ClientExceptionLogConfiguration()
 {
     this.IsLoggingEnabled           = AppConfigLoader.GetConfigBoolValue("IsClientExceptionLoggingEnabled", true);
     this.LogPath                    = AppConfigLoader.GetConfigStringValue("ClientExceptionLogPath", ClientExceptionLogConfiguration.DefaultLogPath);
     this.MaxLogAge                  = AppConfigLoader.GetConfigTimeSpanValue("ClientExceptionMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0));
     this.MaxLogDirectorySizeInBytes = (long)ClientLogConfiguration.GetConfigByteQuantifiedSizeValue("ClientExceptionMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL)).ToBytes();
     this.MaxLogFileSizeInBytes      = (long)ClientLogConfiguration.GetConfigByteQuantifiedSizeValue("ClientExceptionMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL)).ToBytes();
 }
Exemple #9
0
        private bool GetIsInstrumentationEnabled()
        {
            Random random            = new Random();
            double num               = (double)random.Next(0, 100000) / 100000.0;
            double configDoubleValue = AppConfigLoader.GetConfigDoubleValue("ClientInstrumentationProbability", 0.0, 1.0, 1.0);

            return(num < configDoubleValue);
        }
        public static void GetFFOSDOItem(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            GetDistributionGroupCmdlet getDistributionGroupCmdlet = new GetDistributionGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getDistributionGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            DistributionGroup[] array = getDistributionGroupCmdlet.Run();
            if (array == null || array.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            DistributionGroup distributionGroup = array.First <DistributionGroup>();
            DataRow           dataRow           = table.Rows[0];

            dataRow["Identity"]             = new Identity(distributionGroup.Guid.ToString());
            dataRow["DisplayName"]          = distributionGroup.DisplayName;
            dataRow["PrimarySmtpAddress"]   = distributionGroup.PrimarySmtpAddress;
            dataRow["RecipientTypeDetails"] = DistributionGroupHelper.GenerateGroupTypeText(Enum.Parse(typeof(RecipientTypeDetails), distributionGroup.RecipientTypeDetails, true));
            dataRow["GroupType"]            = DistributionGroupHelper.GenerateGroupTypeText(Enum.Parse(typeof(RecipientTypeDetails), distributionGroup.RecipientTypeDetails, true));
            dataRow["Notes"] = distributionGroup.Notes;
            if (distributionGroup.ManagedBy == null || distributionGroup.ManagedBy.Length == 0)
            {
                dataRow["DisplayedManagedBy"] = null;
            }
            else
            {
                string[] value = (from o in distributionGroup.ManagedBy
                                  select o.Name).ToArray <string>();
                dataRow["DisplayedManagedBy"] = value;
            }
            GetGroupCmdlet getGroupCmdlet = new GetGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            Group[] array2 = getGroupCmdlet.Run();
            if (array2 == null || array2.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            Group group = array2.First <Group>();

            if (group.Members == null || group.Members.Length == 0)
            {
                dataRow["MemberCount"] = 0;
            }
            else
            {
                dataRow["MemberCount"] = group.Members.Length;
            }
            dataRow["Notes"] = group.Notes;
        }
 // Token: 0x0600254A RID: 9546 RVA: 0x000875BC File Offset: 0x000857BC
 public OwaServerTraceLogConfiguration()
 {
     this.IsLoggingEnabled           = AppConfigLoader.GetConfigBoolValue("OWAIsServerTraceLoggingEnabled", true);
     this.LogPath                    = AppConfigLoader.GetConfigStringValue("OWATraceLogPath", OwaServerTraceLogConfiguration.DefaultLogPath);
     this.MaxLogAge                  = AppConfigLoader.GetConfigTimeSpanValue("OWATraceMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(5.0));
     this.MaxLogDirectorySizeInBytes = (long)OwaAppConfigLoader.GetConfigByteQuantifiedSizeValue("OWATraceMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL)).ToBytes();
     this.MaxLogFileSizeInBytes      = (long)OwaAppConfigLoader.GetConfigByteQuantifiedSizeValue("OWATraceMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL)).ToBytes();
     this.OwaTraceLoggingThreshold   = AppConfigLoader.GetConfigDoubleValue("OwaTraceLoggingThreshold", 0.0, 0.0, 0.0);
 }
Exemple #12
0
        public static void GetFFOMailUser(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            GetRecipientCmdlet getRecipientCmdlet = new GetRecipientCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getRecipientCmdlet.Authenticator  = PswsAuthenticator.Create();
            getRecipientCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            Recipient[] array = getRecipientCmdlet.Run();
            if (array == null || array.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            Recipient recipient = array.First <Recipient>();
            DataRow   dataRow   = table.Rows[0];

            dataRow["Identity"]           = new Identity(recipient.Guid.ToString());
            dataRow["FirstName"]          = recipient.FirstName;
            dataRow["LastName"]           = recipient.LastName;
            dataRow["DisplayName"]        = recipient.DisplayName;
            dataRow["WindowsLiveID"]      = recipient.WindowsLiveID;
            dataRow["City"]               = recipient.City;
            dataRow["StateOrProvince"]    = recipient.StateOrProvince;
            dataRow["PostalCode"]         = recipient.PostalCode;
            dataRow["CountryOrRegion"]    = recipient.CountryOrRegion.Name;
            dataRow["Phone"]              = recipient.Phone;
            dataRow["Office"]             = recipient.Office;
            dataRow["Notes"]              = recipient.Notes;
            dataRow["Title"]              = recipient.Title;
            dataRow["Department"]         = recipient.Department;
            dataRow["Company"]            = recipient.Company;
            dataRow["Alias"]              = recipient.Alias;
            dataRow["PrimarySmtpAddress"] = recipient.PrimarySmtpAddress;
            dataRow["Name"]               = recipient.Name;
            GetUserCmdlet getUserCmdlet = new GetUserCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getUserCmdlet.Authenticator  = PswsAuthenticator.Create();
            getUserCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            User[] array2 = getUserCmdlet.Run();
            if (array2 == null || array2.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            User user = array2.First <User>();

            dataRow["Initials"]      = user.Initials;
            dataRow["StreetAddress"] = user.StreetAddress;
            dataRow["MobilePhone"]   = user.MobilePhone;
            dataRow["Fax"]           = user.Fax;
            dataRow["HomePhone"]     = user.HomePhone;
            dataRow["WebPage"]       = user.WebPage;
        }
Exemple #13
0
        // Token: 0x06000637 RID: 1591 RVA: 0x000125B4 File Offset: 0x000107B4
        public static ByteQuantifiedSize GetConfigByteQuantifiedSizeValue(string configName, ByteQuantifiedSize defaultValue)
        {
            string             expression = null;
            ByteQuantifiedSize result;

            if (AppConfigLoader.TryGetConfigRawValue(configName, out expression) && ByteQuantifiedSize.TryParse(expression, out result))
            {
                return(result);
            }
            return(defaultValue);
        }
Exemple #14
0
        public static void RemoveFFOMailUser(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            RemoveMailUserCmdlet removeMailUserCmdlet = new RemoveMailUserCmdlet();

            removeMailUserCmdlet.Authenticator  = PswsAuthenticator.Create();
            removeMailUserCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            removeMailUserCmdlet.Identity       = ((Identity)inputRow["Identity"]).RawIdentity;
            removeMailUserCmdlet.Run();
            if (!string.IsNullOrEmpty(removeMailUserCmdlet.Error))
            {
                throw new Exception(removeMailUserCmdlet.Error);
            }
        }
        // Token: 0x06001158 RID: 4440 RVA: 0x000426A0 File Offset: 0x000408A0
        internal override void Initialize()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtml loading begin");
            IntPtr value = NativeMethods.LoadLibrary(Path.GetFullPath(Path.Combine(ExchangeSetupContext.BinPath, "SafeHtmlNativeWrapper.dll")));

            if (value == IntPtr.Zero)
            {
                ExTraceGlobals.ConfigurationManagerTracer.TraceError(0L, "OwaApplication.Initialize: Failed to load SafeHtmlNativeWrapper.");
                Global.SafeHtmlLoaded = false;
            }
            else
            {
                ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtmlNativeWrapper loaded successfully.");
                Global.SafeHtmlLoaded = true;
            }
            SafeHtml.Initialize(ExchangeSetupContext.BinPath + Path.DirectorySeparatorChar);
            ExTraceGlobals.ConfigurationManagerTracer.TraceDebug(0L, "OwaApplication.Initialize: SafeHtml loading finished");
            Global.InitializeSettingsFromWebConfig();
            int workerThreads;
            int num;

            ThreadPool.GetMinThreads(out workerThreads, out num);
            int configIntValue = AppConfigLoader.GetConfigIntValue("ThreadPoolMinIOCPThreads", 0, int.MaxValue, 3 * Environment.ProcessorCount);

            ThreadPool.SetMinThreads(workerThreads, configIntValue);
            OwaApplication.InitializeApplicationCaches();
            RequestDetailsLogger.ApplicationType = LoggerApplicationType.Owa;
            OwaClientLogger.Initialize();
            OwaClientTraceLogger.Initialize();
            OwaServerLogger.Initialize();
            OwaServerTraceLogger.Initialize();
            SettingOverrideSync.Instance.Start(true);
            LoggerSettings.MaxAppendableColumnLength   = null;
            LoggerSettings.ErrorMessageLengthThreshold = null;
            Global.ResponseShapeResolver = new OwaResponseShapeResolver();
            Global.EwsClientMailboxSessionCloningHandler = new EwsClientMailboxSessionCloningHandler(UserContextManager.GetClonedMailboxSession);
            Global.DefaultMapiClientType             = "Client=OWA";
            MailboxSession.DefaultFoldersToForceInit = OwaApplication.foldersToForceInitialize;
            UserContextManager.Initialize();
            if (Globals.OwaIsNoRecycleEnabled)
            {
                OwaVersionId.InitializeOwaVersionReadingTimer();
            }
            KillBitTimer.Singleton.Start();
            KillbitWatcher.TryWatch(new KillbitWatcher.ReadKillBitFromFileCallback(KillBitHelper.ReadKillBitFromFile));
            OwaServerLogger.AppendToLog(new OwaAppStartLogEvent((double)stopwatch.ElapsedMilliseconds));
        }
Exemple #16
0
        private static UserContextKey GetUserContextKey(HttpContext httpContext, ClientSecurityContext overrideClientSecurityContext, out UserContextCookie userContextCookie)
        {
            UserContextKey userContextKey    = null;
            string         explicitLogonUser = UserContextUtilities.GetExplicitLogonUser(httpContext);

            if (string.IsNullOrEmpty(explicitLogonUser))
            {
                userContextCookie = UserContextCookie.GetUserContextCookie(httpContext);
                if (userContextCookie != null)
                {
                    ExTraceGlobals.UserContextCallTracer.TraceDebug <UserContextCookie>(0L, "Found cookie in the request: {0}", userContextCookie);
                    if (overrideClientSecurityContext == null)
                    {
                        userContextKey = UserContextKey.CreateFromCookie(userContextCookie, httpContext);
                    }
                    else
                    {
                        userContextKey = UserContextKey.CreateFromCookie(userContextCookie, overrideClientSecurityContext.UserSid);
                    }
                }
            }
            else
            {
                userContextCookie = null;
                if (UserContextManager.RequestRequiresSharedContext(httpContext))
                {
                    userContextKey = UserContextKey.Create("D894745CADD64DB9B00309200288E1E7", "SharedAdmin", explicitLogonUser);
                }
                else
                {
                    SecurityIdentifier securityIdentifier = httpContext.User.Identity.GetSecurityIdentifier();
                    if (securityIdentifier == null)
                    {
                        ExTraceGlobals.UserContextCallTracer.TraceDebug <IIdentity>(0L, "UserContextManager.GetUserContextKey: current user has no security identifier - '{0}'", httpContext.User.Identity);
                        ExWatson.SendReport(new InvalidOperationException(string.Format("UserContextManager.GetUserContextKey: current user has no security identifier - '{0}'", httpContext.User.Identity)), ReportOptions.None, null);
                        return(null);
                    }
                    string logonUniqueKey = securityIdentifier.ToString();
                    string text           = httpContext.Request.Headers["X-OWA-Test-ExplicitLogonUserId"];
                    if (string.IsNullOrEmpty(text) || !AppConfigLoader.GetConfigBoolValue("Test_OwaAllowHeaderOverride", false))
                    {
                        text = "B387FD19C8C4416694EB79909BED70B5";
                    }
                    userContextKey = UserContextKey.Create(text, logonUniqueKey, explicitLogonUser);
                    ExTraceGlobals.UserContextCallTracer.TraceDebug <UserContextKey>(0L, "Cookie not found but this is explicit logon. Generated Key: {0}", userContextKey);
                }
            }
            return(userContextKey);
        }
Exemple #17
0
 public AppConfig()
 {
     this.TMSyncCacheSlidingExpiry       = AppConfigLoader.GetConfigTimeSpanValue("TMSyncCacheSlidingExpiry", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.FromMinutes(15.0));
     this.TMSyncCacheAbsoluteExpiry      = AppConfigLoader.GetConfigTimeSpanValue("TMSyncCacheAbsoluteExpiry", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.FromHours(4.0));
     this.TMSyncCacheBucketCount         = AppConfigLoader.GetConfigIntValue("TMSyncCacheBucketCount", 1, int.MaxValue, 10);
     this.TMSyncCacheBucketSize          = AppConfigLoader.GetConfigIntValue("TMSyncCacheBucketSize", 1, int.MaxValue, 100);
     this.TMSyncMaxJobQueueLength        = AppConfigLoader.GetConfigIntValue("TMSyncMaxJobQueueLength", 1, int.MaxValue, 100);
     this.TMSyncMaxPendingJobs           = AppConfigLoader.GetConfigIntValue("TMSyncMaxPendingJobs", 1, int.MaxValue, 5);
     this.TMSyncSharePointQueryPageSize  = AppConfigLoader.GetConfigIntValue("TMSyncSharePointQueryPageSize", 1, int.MaxValue, 100);
     this.TMSyncDispatcherWakeupInterval = AppConfigLoader.GetConfigTimeSpanValue("TMSyncDispatcherWakeupInterval", TimeSpan.FromMilliseconds(100.0), TimeSpan.MaxValue, TimeSpan.FromSeconds(5.0));
     this.TMSyncMinSyncInterval          = AppConfigLoader.GetConfigTimeSpanValue("TMSyncMinSyncInterval", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromSeconds(30.0));
     this.TMSyncUseOAuth         = AppConfigLoader.GetConfigBoolValue("TMSyncUseOAuth", true);
     this.TMSyncHttpDebugEnabled = AppConfigLoader.GetConfigBoolValue("TMSyncHttpDebugEnabled", false);
     this.EnqueueRequestTimeout  = AppConfigLoader.GetConfigTimeSpanValue("EnqueueRequestTimeout", TimeSpan.FromSeconds(5.0), TimeSpan.MaxValue, TimeSpan.FromSeconds(300.0));
 }
Exemple #18
0
        public DiagnosticsAggregationServiceletConfig()
        {
            this.Enabled = AppConfigLoader.GetConfigBoolValue("DiagnosticsAggregationServiceletEnabled", true);
            this.TimeSpanForQueueDataBeingCurrent = AppConfigLoader.GetConfigTimeSpanValue("TimeSpanForQueueDataBeingCurrent", TimeSpan.FromMinutes(1.0), TimeSpan.FromHours(1.0), TimeSpan.FromMinutes(11.0));
            this.TimeSpanForQueueDataBeingStale   = AppConfigLoader.GetConfigTimeSpanValue("TimeSpanForQueueDataBeingStale", TimeSpan.FromMinutes(1.0), TimeSpan.FromHours(10.0), TimeSpan.FromHours(1.0));
            this.LoggingEnabled = AppConfigLoader.GetConfigBoolValue("DiagnosticsAggregationLoggingEnabled", false);
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            string   path = Path.Combine(Directory.GetParent(Path.GetDirectoryName(executingAssembly.Location)).FullName, "TransportRoles\\Logs\\DiagnosticsAggregation\\");

            this.LogFileDirectoryPath = AppConfigLoader.GetConfigStringValue("DiagnosticsAggregationLogFileDirectoryPath", Path.GetFullPath(path));
            int configIntValue = AppConfigLoader.GetConfigIntValue("DiagnosticsAggregationLogFileMaxSizeInMB", 1, 10000, 2);

            this.LogFileMaxSize = ByteQuantifiedSize.FromMB((ulong)((long)configIntValue));
            int configIntValue2 = AppConfigLoader.GetConfigIntValue("DiagnosticsAggregationLogFileMaxDirectorySizeInMB", 1, 10000, 10);

            this.LogFileMaxDirectorySize = ByteQuantifiedSize.FromMB((ulong)((long)configIntValue2));
            this.LogFileMaxAge           = AppConfigLoader.GetConfigTimeSpanValue("DiagnosticsAggregationLogFileMaxAge", TimeSpan.FromMinutes(1.0), TimeSpan.FromDays(365.0), TimeSpan.FromDays(15.0));
        }
        public static List <string> ReadCommaSeperatedStringValue(string configName, List <string> defaultValue)
        {
            string text = null;

            if (!AppConfigLoader.TryGetConfigRawValue(configName, out text))
            {
                return(defaultValue);
            }
            string[] array = text.Split(new char[]
            {
                ','
            }, StringSplitOptions.RemoveEmptyEntries);
            if (array == null || array.Length == 0)
            {
                return(defaultValue);
            }
            return(new List <string>(array));
        }
Exemple #20
0
        public void ConfigLoadTest()
        {
            const string       inputPath   = "workspace";
            const string       contentPath = "hello world";
            const int          count       = 9999;
            IConfigurationRoot config      = new ConfigurationBuilder().AddInMemoryCollection(
                new Dictionary <string, string>()
            {
                { "path:input", inputPath },
                { "path:route:content", contentPath },
                { "recentPostsCount", count.ToString() }
            }
                ).Build();

            AppConfigLoader.LoadConfig(config);
            Assert.Equal(inputPath, AppPathInfo.InputPath);
            Assert.Equal(System.Web.HttpUtility.UrlEncode(contentPath), RoutePathInfo.ContentPath);
            Assert.Equal(count, ConvertingInfo.RecentPostsCount);
            Assert.True(ConvertingInfo.UseSummary);
        }
Exemple #21
0
        public ClientWatsonParameters(string owaVersion)
        {
            this.symbolsFolderPath          = AppConfigLoader.GetConfigStringValue("ClientWatsonSymbolsFolderPath", Path.Combine(ExchangeSetupContext.InstallPath, string.Format("ClientAccess\\Owa\\{0}\\ScriptSymbols", ResourcePathBuilderUtilities.GetResourcesRelativeFolderPath(owaVersion))));
            this.maxNumberOfWatsonsPerError = AppConfigLoader.GetConfigIntValue("ClientWatsonMaxReportsPerError", 1, int.MaxValue, 5);
            TimeSpan configTimeSpanValue = AppConfigLoader.GetConfigTimeSpanValue("ClientWatsonResetErrorCountInterval", TimeSpan.FromSeconds(1.0), TimeSpan.FromDays(1.0), TimeSpan.FromHours(1.0));

            this.resetErrorsReportedTimer = new Timer(delegate(object param0)
            {
                this.clientErrorsReported = new ConcurrentDictionary <int, int>();
            }, null, configTimeSpanValue, configTimeSpanValue);
            Version installedVersion = ExchangeSetupContext.InstalledVersion;

            this.ExchangeSourcesPath = string.Format("\\\\exsrc\\SOURCES\\ALL\\{0:D2}.{1:D2}.{2:D4}.{3:D3}\\", new object[]
            {
                installedVersion.Major,
                installedVersion.Minor,
                installedVersion.Build,
                installedVersion.Revision
            });
            this.owaVersion = owaVersion;
        }
Exemple #22
0
        private CmdletTaskFactory()
        {
            foreach (object obj in Enum.GetValues(typeof(TaskModuleKey)))
            {
                TaskModuleKey key = (TaskModuleKey)obj;
                TaskModuleFactory.DisableModule(key);
            }
            TaskModuleFactory.EnableModule(TaskModuleKey.RunspaceServerSettingsInit);
            TaskModuleFactory.EnableModule(TaskModuleKey.RunspaceServerSettingsFinalize);
            string configStringValue = AppConfigLoader.GetConfigStringValue("PSDirectInvokeEnabledModules", string.Empty);

            string[] array = configStringValue.Split(new char[]
            {
                ','
            }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string value in array)
            {
                TaskModuleKey key2;
                if (Enum.TryParse <TaskModuleKey>(value, true, out key2))
                {
                    TaskModuleFactory.EnableModule(key2);
                }
            }
        }
        public static void NewFFOGroup(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            NewDistributionGroupCmdlet newDistributionGroupCmdlet = new NewDistributionGroupCmdlet();

            newDistributionGroupCmdlet.Authenticator      = PswsAuthenticator.Create();
            newDistributionGroupCmdlet.HostServerName     = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            newDistributionGroupCmdlet.Name               = inputRow["Name"].ToString();
            newDistributionGroupCmdlet.DisplayName        = inputRow["Name"].ToString();
            newDistributionGroupCmdlet.Alias              = inputRow["Alias"].ToString();
            newDistributionGroupCmdlet.PrimarySmtpAddress = inputRow["PrimarySmtpAddress"].ToString();
            newDistributionGroupCmdlet.Notes              = inputRow["Notes"].ToString();
            string[] managedBy = (from o in (object[])inputRow["ManagedBy"]
                                  select((Identity)o).DisplayName).ToArray <string>();
            newDistributionGroupCmdlet.ManagedBy = managedBy;
            string[] members = (from o in (object[])inputRow["Members"]
                                select((Identity)o).DisplayName).ToArray <string>();
            newDistributionGroupCmdlet.Members = members;
            newDistributionGroupCmdlet.Type    = inputRow["GroupType"].ToString();
            newDistributionGroupCmdlet.Run();
            if (!string.IsNullOrEmpty(newDistributionGroupCmdlet.Error))
            {
                throw new Exception(newDistributionGroupCmdlet.Error);
            }
        }
Exemple #24
0
 private int GetInstrumentationUploadDuration()
 {
     return(AppConfigLoader.GetConfigIntValue("ClientInstrumentationUploadDuration", 1, int.MaxValue, 55));
 }
Exemple #25
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var appSettings = new AppConfigLoader(_config).LoadSettings();

            services.AddSingleton(appSettings);

            if (!appSettings.EnableLoggingEndpoint)
            {
                LogManager.Configuration.Variables["endpointLoggingLevel"] = "OFF";
                LogManager.ReconfigExistingLoggers();
            }

            _logger.LogInformation(appSettings.ToString());

            services.AddLogging(builder => { builder.AddConsole(); });

            services.AddProblemDetails(_environment.IsDevelopment());
            _logger.LogInformation($"Environment is Dev: {_environment.IsDevelopment()}");


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2).AddJsonOptions(opt =>
            {
                opt.SerializerSettings.ContractResolver = new DefaultContractResolver {
                    NamingStrategy = new CamelCaseNamingStrategy()
                };
            });

            var encryptionSettings = new EncryptionConfigLoader(_config).LoadEncryptionConfig();

            services.AddSingleton(encryptionSettings);
            _logger.LogInformation(encryptionSettings.ToString());

            var appAuthSettings = new AuthApiConfigLoader(_config).LoadAuthConfig();

            services.AddSingleton(appAuthSettings);

            _logger.LogInformation(appAuthSettings.ToString());

            services.AddSingleton <IAuthHttpClient, AuthHttpClient>();

            services.AddScoped <IPracticeProvider>(sp => new PracticeProvider(appSettings.ConnectionString));
            services.AddScoped <IPracticeEnvironmentCache, PracticeEnvironmentCache>();

            //runtime resolution via factory:  https://stackoverflow.com/questions/37744637/how-can-i-pass-a-runtime-parameter-as-part-of-the-dependency-resolution
            var fileStreamLogger = services.BuildServiceProvider().GetService <ILogger <FileStreamProvider> >();

            services.AddTransient <IStreamProvider, FileStreamProvider>((sp) => new FileStreamProvider(fileStreamLogger, "", "version.txt"));

            services.AddTransient <IApplicationAuthService, ApplicationAuthService>();
            services.AddTransient <ValidateTokenFilter>();

            services.AddTransient((serviceProvider) =>
            {
                return(new Func <string, IClinicProvider>((env) => new DataAccess.GenPro.ClinicProvider(env, appSettings.ConnectionString)));
            });

            services.AddTransient((serviceProvider) =>
            {
                return(new Func <string, ITeamProvider>((env) => new TeamProvider(appSettings.ConnectionString)));
            });

            ConfigureSwagger(services, appSettings.ApplicationVersion);
            ConfigureAuth(services, appSettings.ClaimsSettingsModel);
        }
        public static void GetFFOItem(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            GetDistributionGroupCmdlet getDistributionGroupCmdlet = new GetDistributionGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getDistributionGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            DistributionGroup[] array = getDistributionGroupCmdlet.Run();
            if (array == null || array.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            DistributionGroup distributionGroup = array.First <DistributionGroup>();
            DataRow           dataRow           = table.Rows[0];

            dataRow["Identity"]           = new Identity(distributionGroup.Guid.ToString());
            dataRow["DisplayName"]        = distributionGroup.DisplayName;
            dataRow["Alias"]              = distributionGroup.Alias;
            dataRow["PrimarySmtpAddress"] = distributionGroup.PrimarySmtpAddress;
            dataRow["Notes"]              = distributionGroup.Notes;
            if (distributionGroup.ManagedBy == null || distributionGroup.ManagedBy.Length == 0)
            {
                dataRow["ManagedBy"] = null;
            }
            else
            {
                dataRow["ManagedBy"] = (from g in distributionGroup.ManagedBy
                                        select new JsonDictionary <object>(new Dictionary <string, object>
                {
                    {
                        "__type",
                        "JsonDictionaryOfanyType:#Microsoft.Exchange.Management.ControlPanel"
                    },
                    {
                        "Identity",
                        new Identity(g.Name, g.Name)
                    },
                    {
                        "DisplayName",
                        g.Name
                    },
                    {
                        "Name",
                        g.Name
                    }
                })).ToArray <JsonDictionary <object> >();
            }
            dataRow["EmailAddresses"] = distributionGroup.EmailAddresses;
            GetGroupCmdlet getGroupCmdlet = new GetGroupCmdlet
            {
                Identity = ((Identity)inputRow["Identity"]).RawIdentity
            };

            getGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            getGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            Group[] array2 = getGroupCmdlet.Run();
            if (array2 == null || array2.Length == 0)
            {
                throw new ExArgumentOutOfRangeException();
            }
            Group group = array2.First <Group>();

            if (group.Members == null || group.Members.Length == 0)
            {
                dataRow["Members"] = null;
            }
            else
            {
                dataRow["Members"] = (from g in @group.Members
                                      select new JsonDictionary <object>(new Dictionary <string, object>
                {
                    {
                        "__type",
                        "JsonDictionaryOfanyType:#Microsoft.Exchange.Management.ControlPanel"
                    },
                    {
                        "Identity",
                        new Identity(g)
                    },
                    {
                        "DisplayName",
                        g
                    },
                    {
                        "Name",
                        g
                    }
                })).ToArray <JsonDictionary <object> >();
            }
            dataRow["Notes"] = group.Notes;
        }
 // Token: 0x0600252D RID: 9517 RVA: 0x00086508 File Offset: 0x00084708
 private static bool GetEscapeLineBreaksConfigValue()
 {
     return(AppConfigLoader.GetConfigBoolValue("Test_OWAClientLogEscapeLineBreaks", LogRowFormatter.DefaultEscapeLineBreaks));
 }
        public static void SetFFOGroup(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            SetDistributionGroupCmdlet setDistributionGroupCmdlet = new SetDistributionGroupCmdlet();

            setDistributionGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
            setDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            setDistributionGroupCmdlet.Identity       = ((Identity)inputRow["Identity"]).RawIdentity;
            if (!DBNull.Value.Equals(inputRow["DisplayName"]))
            {
                setDistributionGroupCmdlet.DisplayName = inputRow["DisplayName"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Alias"]))
            {
                setDistributionGroupCmdlet.Alias = inputRow["Alias"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["PrimarySmtpAddress"]))
            {
                setDistributionGroupCmdlet.PrimarySmtpAddress = inputRow["PrimarySmtpAddress"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["ManagedBy"]))
            {
                string[] managedBy = (from o in (object[])inputRow["ManagedBy"]
                                      select((Identity)o).DisplayName).ToArray <string>();
                setDistributionGroupCmdlet.ManagedBy = managedBy;
            }
            setDistributionGroupCmdlet.Run();
            if (!string.IsNullOrEmpty(setDistributionGroupCmdlet.Error))
            {
                throw new Exception(setDistributionGroupCmdlet.Error);
            }
            if (!DBNull.Value.Equals(inputRow["MembersRemoved"]) || !DBNull.Value.Equals(inputRow["MembersAdded"]))
            {
                string[] members = (from o in (object[])inputRow["Members"]
                                    select((Identity)o).DisplayName).ToArray <string>();
                UpdateDistributionGroupMemberCmdlet updateDistributionGroupMemberCmdlet = new UpdateDistributionGroupMemberCmdlet();
                updateDistributionGroupMemberCmdlet.Authenticator  = PswsAuthenticator.Create();
                updateDistributionGroupMemberCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
                updateDistributionGroupMemberCmdlet.Identity       = ((Identity)inputRow["Identity"]).RawIdentity;
                updateDistributionGroupMemberCmdlet.Members        = members;
                updateDistributionGroupMemberCmdlet.Run();
                if (!string.IsNullOrEmpty(updateDistributionGroupMemberCmdlet.Error))
                {
                    throw new Exception(updateDistributionGroupMemberCmdlet.Error);
                }
            }
            if (!DBNull.Value.Equals(inputRow["Notes"]))
            {
                SetGroupCmdlet setGroupCmdlet = new SetGroupCmdlet();
                setGroupCmdlet.Authenticator  = PswsAuthenticator.Create();
                setGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
                setGroupCmdlet.Identity       = ((Identity)inputRow["Identity"]).RawIdentity;
                setGroupCmdlet.Notes          = inputRow["Notes"].ToString();
                if (!DBNull.Value.Equals(inputRow["ManagedBy"]))
                {
                    string[] managedBy2 = (from o in (object[])inputRow["ManagedBy"]
                                           select((Identity)o).DisplayName).ToArray <string>();
                    setGroupCmdlet.ManagedBy = managedBy2;
                }
                setGroupCmdlet.Run();
                if (!string.IsNullOrEmpty(setGroupCmdlet.Error))
                {
                    throw new Exception(setGroupCmdlet.Error);
                }
            }
        }
Exemple #29
0
        public static void SetFFOMailUser(DataRow inputRow, DataTable table, DataObjectStore store)
        {
            SetUserCmdlet setUserCmdlet = new SetUserCmdlet();

            setUserCmdlet.Authenticator  = PswsAuthenticator.Create();
            setUserCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null);
            setUserCmdlet.Identity       = ((Identity)inputRow["Identity"]).RawIdentity;
            if (!DBNull.Value.Equals(inputRow["DisplayName"]))
            {
                setUserCmdlet.DisplayName = inputRow["DisplayName"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["FirstName"]))
            {
                setUserCmdlet.FirstName = inputRow["FirstName"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["LastName"]))
            {
                setUserCmdlet.LastName = inputRow["LastName"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Initials"]))
            {
                setUserCmdlet.Initials = inputRow["Initials"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["City"]))
            {
                setUserCmdlet.City = inputRow["City"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Office"]))
            {
                setUserCmdlet.Office = inputRow["Office"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["StateOrProvince"]))
            {
                setUserCmdlet.StateOrProvince = inputRow["StateOrProvince"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["PostalCode"]))
            {
                setUserCmdlet.PostalCode = inputRow["PostalCode"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["CountryOrRegion"]))
            {
                setUserCmdlet.CountryOrRegion = inputRow["CountryOrRegion"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Phone"]))
            {
                setUserCmdlet.Phone = inputRow["Phone"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Notes"]))
            {
                setUserCmdlet.Notes = inputRow["Notes"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Title"]))
            {
                setUserCmdlet.Title = inputRow["Title"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Department"]))
            {
                setUserCmdlet.Department = inputRow["Department"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Company"]))
            {
                setUserCmdlet.Company = inputRow["Company"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["StreetAddress"]))
            {
                setUserCmdlet.StreetAddress = inputRow["StreetAddress"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["MobilePhone"]))
            {
                setUserCmdlet.MobilePhone = inputRow["MobilePhone"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["Fax"]))
            {
                setUserCmdlet.Fax = inputRow["Fax"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["HomePhone"]))
            {
                setUserCmdlet.HomePhone = inputRow["HomePhone"].ToString();
            }
            if (!DBNull.Value.Equals(inputRow["WebPage"]))
            {
                setUserCmdlet.WebPage = inputRow["WebPage"].ToString();
            }
            setUserCmdlet.Run();
            if (!string.IsNullOrEmpty(setUserCmdlet.Error))
            {
                throw new Exception(setUserCmdlet.Error);
            }
        }
Exemple #30
0
 /// <summary>
 /// Creates instance for converting.
 /// </summary>
 public Converter() : this(new FileSystem())
 {
     AppConfigLoader.LoadConfig();
 }