public override AnalysisApplicability CanAnalyze(BinaryAnalyzerContext context, out string reasonForNotAnalyzing)
        {
            PE portableExecutable        = context.PE;
            AnalysisApplicability result = AnalysisApplicability.NotApplicableToSpecifiedTarget;

            reasonForNotAnalyzing = MetadataConditions.ImageIsKernelModeBinary;
            if (portableExecutable.IsKernelMode)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsXBoxBinary;
            if (portableExecutable.IsXBox)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsPreVersion7WindowsCEBinary;
            if (OSVersions.IsWindowsCEPriorToV7(portableExecutable))
            {
                return(result);
            }

            return(AnalysisApplicability.ApplicableToSpecifiedTarget);
        }
        public override AnalysisApplicability CanAnalyzePE(PEBinary target, PropertiesDictionary policy, out string reasonForNotAnalyzing)
        {
            PE portableExecutable        = target.PE;
            AnalysisApplicability result = AnalysisApplicability.NotApplicableToSpecifiedTarget;

            reasonForNotAnalyzing = MetadataConditions.ImageIsKernelModeBinary;
            if (portableExecutable.IsKernelMode)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsXBoxBinary;
            if (portableExecutable.IsXBox)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsPreVersion7WindowsCEBinary;
            if (OSVersions.IsWindowsCEPriorToV7(portableExecutable))
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsBootBinary;
            if (portableExecutable.IsBoot)
            {
                return(result);
            }

            reasonForNotAnalyzing = null;
            return(AnalysisApplicability.ApplicableToSpecifiedTarget);
        }
        public bool CheckEndCreateRegFileAndStartupBatchFile(OSVersions os, ConfigClass configClass)
        {
            bool totalcheck = true;

            try
            {
                if (File.Exists(_regFilepath + @"\firstLogon.exe"))
                {
                    _checkRegKeySettingsForOtherUsers.Add(true);
                }
                else
                {
                    _checkRegKeySettingsForOtherUsers.Add(false);
                }
                if (File.Exists(_regFilepath + @"\firstLogon.bat"))
                {
                    _checkRegKeySettingsForOtherUsers.Add(true);
                }
                else
                {
                    _checkRegKeySettingsForOtherUsers.Add(false);
                }

                FileHandling  _fileHandling = new FileHandling();
                List <string> regSettings   = new List <string>();
                regSettings = _fileHandling.ReadWholeFile(_regFilepath + @"\firstLogon.reg");

                foreach (string str in configClass.GetScriptHandling.RegistrySettings)
                {
                    if (regSettings.Contains(str))
                    {
                        _checkRegKeySettingsForOtherUsers.Add(true);
                    }
                    else
                    {
                        _checkRegKeySettingsForOtherUsers.Add(false);
                    }
                }

                foreach (bool b in _checkRegKeySettingsForOtherUsers)
                {
                    if (!b)
                    {
                        totalcheck = false;
                        return(totalcheck);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Check start up files for accounts are created", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Check start up files for accounts are created", ex.Message));
            }
            return(totalcheck);
        }
        public override AnalysisApplicability CanAnalyze(BinaryAnalyzerContext context, out string reasonForNotAnalyzing)
        {
            PE portableExecutable        = context.PE;
            AnalysisApplicability result = AnalysisApplicability.NotApplicableToSpecifiedTarget;

            reasonForNotAnalyzing = MetadataConditions.ImageIs64BitBinary;
            if (context.PE.PEHeaders.PEHeader.Magic == PEMagic.PE32Plus)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsKernelModeBinary;
            if (portableExecutable.IsKernelMode)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsXBoxBinary;
            if (portableExecutable.IsXBox)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsResourceOnlyBinary;
            if (portableExecutable.IsResourceOnly)
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsPreVersion7WindowsCEBinary;
            if (OSVersions.IsWindowsCEPriorToV7(portableExecutable))
            {
                return(result);
            }

            reasonForNotAnalyzing = MetadataConditions.ImageIsBootBinary;
            if (portableExecutable.IsBoot)
            {
                return(result);
            }

            reasonForNotAnalyzing = null;
            return(AnalysisApplicability.ApplicableToSpecifiedTarget);
        }
Esempio n. 5
0
        static public string GetOSOperations(OSVersions osVersion, String operation)
        {
            String version = Environment.OSVersion.Version.ToString();

            switch (osVersion)
            {
            case OSVersions.AllOS:
                return(RES_OS_ALL.ResourceManager.GetString(operation));

            case OSVersions.WindowsXP:
                return(RES_OS_XP.ResourceManager.GetString(operation));

            case OSVersions.WindowsXP32:
                return(RES_OS_XP.ResourceManager.GetString(operation));

            case OSVersions.WindowsXP64:
                return(RES_OS_XP.ResourceManager.GetString(operation));

            case OSVersions.W2003:
                return(RES_OS_W2003.ResourceManager.GetString(operation));

            case OSVersions.WindowsVista:
                return(RES_OS_VISTA.ResourceManager.GetString(operation));

            case OSVersions.WindowsVista32:
                return(RES_OS_VISTA.ResourceManager.GetString(operation));

            case OSVersions.WindowsVista64:
                return(RES_OS_VISTA.ResourceManager.GetString(operation));

            case OSVersions.Windows7:
                return(RES_OS_W7.ResourceManager.GetString(operation));

            case OSVersions.W2008:
                return(RES_OS_2008.ResourceManager.GetString(operation));

            case OSVersions.W2008R2:
                return(RES_OS_2008.ResourceManager.GetString(operation));

            default:
                throw new NotImplementedException();
            }
        }
        //methods
        public void CreateRegFileAndStartupBatchFile(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string driveLetter = Environment.GetEnvironmentVariable("SystemRoot");
                driveLetter  = driveLetter.Substring(0, 3);
                _regFilepath = driveLetter + "Actemium";
                DirectoryInfo di = Directory.CreateDirectory(_regFilepath);
                di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;

                configClass.GetScriptHandling.AddRegistrySettingsToFile(_regFilepath + @"\firstLogon.reg");

                string firstLogonEXEpath = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\ConfigFiles\FirstLogon\firstLogon.exe";
                string firstLogonBATpath = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\ConfigFiles\FirstLogon\firstLogon.bat";
                if (!File.Exists(firstLogonEXEpath))
                {
                    DialogResult result = MessageBox.Show("firstLogon.exe is not found in the root of this application", "Executable not found", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                    if (result == DialogResult.Retry)
                    {
                        CreateRegFileAndStartupBatchFile(os, configClass);
                    }
                }
                if (!File.Exists(firstLogonBATpath))
                {
                    DialogResult result = MessageBox.Show("firstLogon.bat is not found in the root of this application", "Executable not found", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                    if (result == DialogResult.Retry)
                    {
                        CreateRegFileAndStartupBatchFile(os, configClass);
                    }
                }
                if (!File.Exists(_regFilepath + @"\firstLogon.exe"))
                {
                    File.Copy(firstLogonEXEpath, _regFilepath + @"\firstLogon.exe");
                }

                if (!File.Exists(_regFilepath + @"\firstLogon.bat"))
                {
                    File.Copy(firstLogonBATpath, _regFilepath + @"\firstLogon.bat");
                }

                string regPath      = "";
                string regKey       = "";
                string value        = _regFilepath + @"\firstLogon.exe";
                string propertyType = "String";

                if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "FirstLogonPath") != null)
                {
                    regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "FirstLogonPath");
                }
                else
                {
                    regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "FirstLogonPath");
                }
                regKey = "SetCurrentUserSettingsActemium";
                configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0},{1})", "MainEndCreateRegFileAndStartupBatchFile", CLASSNAME, ex, os);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Create start up files for other accounts", ex.Message));
            }
        }
Esempio n. 7
0
        public void SetNetworkStaticConfigure(OSVersions os, ConfigClass configClass)

        {
            const string FUNCTIONNAME = "SetNetworkConfigure";

            Trace.WriteVerbose("()", FUNCTIONNAME, CLASSNAME);
            try
            {
                string        staticIpAddress      = "";
                string        staticSubnetMask     = "";
                string        staticDefaultGateway = "";
                string        staticCaption        = "";
                List <string> ListOfDnsServers     = new List <string>();
                foreach (NewNetwork nn in _newNetwork)
                {
                    if (nn.IpAddress.Length != 0)
                    {
                        staticIpAddress = nn.IpAddress;
                    }
                    if (nn.SubnetMask.Length != 0)
                    {
                        staticSubnetMask = nn.SubnetMask;
                    }
                    if (nn.Gateway.Length != 0)
                    {
                        staticDefaultGateway = nn.Gateway;
                    }
                    if (nn.SetDnsServers.Count != 0)
                    {
                        ListOfDnsServers = nn.SetDnsServers;
                    }
                    if (nn.NetCaption.Length != 0)
                    {
                        staticCaption = nn.NetCaption;
                    }

                    if (_ipAutoAssign == false)
                    {
                        _dnsAutoAssign = false;
                    }
                    if (_ipAutoAssign == false)
                    {
                        configClass.GetScriptHandling.SetStaticIPAddresses(staticIpAddress, staticSubnetMask, staticDefaultGateway, ListOfDnsServers, staticCaption);
                    }
                    else if (_ipAutoAssign == true && _dnsAutoAssign == true)
                    {
                        configClass.GetScriptHandling.SetAutoIpAddresses(staticCaption);
                    }
                    else if (_ipAutoAssign == true && _dnsAutoAssign == false)
                    {
                        foreach (string dnsString in ListOfDnsServers)
                        {
                            configClass.GetScriptHandling.SetStaticDnsAddresses(dnsString, staticCaption);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.WriteError("({0})", FUNCTIONNAME, CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Set IP settings", ex.Message));
            }
        }
        //methods
        public void MakeAutoplaySettings(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath      = "";
                string regKey       = "";
                string value        = "";
                string propertyType = "DWORD";

                if (_autoPlayOff)
                {
                    if (_autoPlaySetting != -1)
                    {
                        #region All drives
                        if (_autoPlaySetting == 1)
                        {
                            if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                            {
                                regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                            }
                            else
                            {
                                regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                            }
                            if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                            {
                                regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                            }
                            else
                            {
                                regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                            }
                            value = "255";
                            configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        }
                        #endregion All drives
                        #region CD-ROM drives
                        if (_autoPlaySetting == 0)
                        {
                            if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                            {
                                regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                            }
                            else
                            {
                                regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                            }
                            if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                            {
                                regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                            }
                            else
                            {
                                regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                            }
                            value = "181";

                            configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        }
                        #endregion CD-ROM drives
                    }
                }
                #region Enable all Drives
                else
                {
                    if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                    {
                        regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                    }
                    else
                    {
                        regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                    }
                    if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                    {
                        regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                    }
                    else
                    {
                        regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                    }
                    configClass.GetScriptHandling.RemoveRegisterKey(regPath, regKey);
                }
                #endregion Enable all drives
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Make autoplay settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Make autoplay settings", ex.Message));
            }
        }
 public static bool IsLessThan(this OperatingSystem os, OSVersions version)
 {
     return(os.Version.Build < (int)version);
 }
        public bool CheckAutoLogonSettings(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath = "";
                string regKey  = "";
                string value   = "";

                #region Automatic login setting
                if (_autologonInUse)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonRegPath");
                    }
                    #endregion RegPath

                    #region Username
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonUsername") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonUsername");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonUsername");
                    }
                    value = _usernameAutoLogon; // name
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoLogonSettings.Add(true);
                    }
                    else
                    {
                        _checkAutoLogonSettings.Add(false);
                    }
                    #endregion  Username
                    //TODO:  Powershell kan geen string vergelijken met speciale tekens

                    /*
                     #region Pasword
                     * string password = "";
                     * if (_passwordAutoLogon == "PassWordIsEncrypted")
                     * {
                     *  EncryptionPassword enc = new EncryptionPassword(configClass);
                     *  password = enc.GetKey("AutoLogon");
                     * }
                     * else
                     * {
                     *  password = _passwordAutoLogon;
                     * }
                     * if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword") != null)
                     * {
                     *  regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword");
                     * }
                     * else
                     * {
                     *  regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonPassword");
                     * }
                     * value = password; //password
                     * if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value)) TODO: Powershell kan gen string vergelijken met speciale tekens
                     * {
                     *  _checkAutoLogonSettings.Add(true);
                     * }
                     * else
                     * {
                     *  _checkAutoLogonSettings.Add(false);
                     * }
                     *
                     #endregion Pasword*/

                    #region DomainName
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonDomainName") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonDomainName");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonDomainName");
                    }
                    value = System.Environment.MachineName;//Domain
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoLogonSettings.Add(true);
                    }
                    else
                    {
                        _checkAutoLogonSettings.Add(false);
                    }
                    #endregion DomainName

                    #region SetAutoLogon
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoAdminLogon");
                    }
                    value = "1";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoLogonSettings.Add(true);
                    }
                    else
                    {
                        _checkAutoLogonSettings.Add(false);
                    }
                    #endregion SetAutoLogon
                }
                #endregion Automatic login setting
                #region Disable auto login
                else
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonRegPath");
                    }
                    #endregion RegPath
                    #region Pasword
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonPassword");
                    }
                    value = "null";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoLogonSettings.Add(false);
                    }
                    else
                    {
                        _checkAutoLogonSettings.Add(true);
                    }
                    #endregion Pasword
                    #region SetAutoLogon
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoAdminLogon");
                    }
                    value = "0";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoLogonSettings.Add(true);
                    }
                    else
                    {
                        _checkAutoLogonSettings.Add(false);
                    }
                    #endregion SetAutoLogon
                }
                #endregion Disable auto login


                foreach (bool b in _checkAutoLogonSettings)
                {
                    if (!b)
                    {
                        AutoLogonCheck = false;
                        return(AutoLogonCheck);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Check autologin settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Check autologin settings", ex.Message));
                AutoLogonCheck = false;
            }
            return(AutoLogonCheck);
        }
        //methods
        public void AutlogonSettings(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath      = "";
                string regKey       = "";
                string value        = "";
                string propertyType = "String";

                #region Auto-login set for user
                if (_autologonInUse)
                {
                    if (configClass.ConfSetWindowsUsers.CheckIfUserExist(UsernameAutoLogon, configClass))
                    {
                        #region RegPath
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath") != null)
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath");
                        }
                        else
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonRegPath");
                        }
                        #endregion RegPath
                        #region Username
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonUsername") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonUsername");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonUsername");
                        }
                        value = _usernameAutoLogon; // name
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion  Username
                        #region Pasword
                        string password = "";
                        if (_passwordAutoLogon == "PassWordIsEncrypted")
                        {
                            EncryptionPassword enc = new EncryptionPassword(configClass);
                            password = enc.GetKey("AutoLogon");
                        }
                        else
                        {
                            password = _passwordAutoLogon;
                        }

                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonPassword");
                        }
                        value = password; //password
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion Pasword
                        #region DomainName
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonDomainName") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonDomainName");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonDomainName");
                        }
                        value = System.Environment.MachineName;//Domain
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion DomainName
                        #region SetAutoLogon
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoAdminLogon");
                        }
                        value = "1";
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion SetAutoLogon
                    }

                    else
                    {
                        configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Autologon settings", "Gebruikers account niet beschikbaar"));
                        AutoLogonCheck = false;
                    }
                }
                #endregion Auto-login set for user
                #region Disable Auto login
                else
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonRegPath");
                    }
                    #endregion RegPath
                    #region Pasword
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoLogonPassword");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoLogonPassword");
                    }
                    configClass.GetScriptHandling.RemoveRegisterKey(regPath, regKey);
                    #endregion Pasword
                    #region SetAutoLogon
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "AutoAdminLogon");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoAdminLogon");
                    }
                    value = "0";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion SetAutoLogon
                }
                #endregion Disable Auto login
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Autologon settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Autologon settings", ex.Message));
                AutoLogonCheck = false;
            }
        }
Esempio n. 12
0
        public bool CheckexplorerMapOptions(OSVersions os, ConfigClass configClass)
        {
            bool totalcheck = true;

            try
            {
                string regPath = "";
                string regKey  = "";
                string value   = "";

                _checkWindowsExplorerFolderOptions.Clear();

                #region Automatically search for network folders and printers
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }
                if (ResourceHelper.GetOSOperations(os, "EMONoNetCrawling") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMONoNetCrawling");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMONoNetCrawling");
                }
                if (_automaticallySearchNetworkFoldersAndPrinters)
                {
                    value = "0";
                }
                else
                {
                    value = "1";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }


                #endregion
                #region Display the contents of system folders

                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOWebViewBarricade") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOWebViewBarricade");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOWebViewBarricade");
                }
                if (_displayContentOfSystemFolder)
                {
                    value = "1";
                }
                else
                {
                    value = "0";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }


                #endregion
                #region Display the full path in the Address bar
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsCabinetState") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsCabinetState");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsCabinetState");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOFullPathAddress") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOFullPathAddress");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOFullPathAddress");
                }
                if (_displayFullPathInAddressBar)
                {
                    value = "1";
                }
                else
                {
                    value = "0";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }

                #endregion
                #region Show hidden files and folders
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOHidden") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOHidden");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOHidden");
                }
                if (_showHiddenFolders)
                {
                    value = "1";
                }
                else
                {
                    value = "2";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }

                #endregion
                #region Hide extensions for known file types
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOHideFileExt") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOHideFileExt");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOHideFileExt");
                }
                if (_hideExtensions)
                {
                    value = "1";
                }
                else
                {
                    value = "0";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }
                #endregion
                #region Hide protected operating system files
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOShowSuperHidden") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOShowSuperHidden");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOShowSuperHidden");
                }
                if (_hideProtectedOSFiles)
                {
                    value = "0";
                }
                else
                {
                    value = "1";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }
                #endregion
                #region The view settings for each folder
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOClassicViewState") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOClassicViewState");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOClassicViewState");
                }
                if (_rememberEachFoldersViewSetting)
                {
                    value = "0";
                }
                else
                {
                    value = "1";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }

                #endregion
                #region Show encrypted or compressed NTFS files in color
                if (ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced") != null)
                {
                    regPath = ResourceHelper.GetOSOperations(os, "EMOregPathfolderOptionsAdvanced");
                }
                else
                {
                    regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOregPathfolderOptionsAdvanced");
                }

                if (ResourceHelper.GetOSOperations(os, "EMOShowCompColor") != null)
                {
                    regKey = ResourceHelper.GetOSOperations(os, "EMOShowCompColor");
                }
                else
                {
                    regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "EMOShowCompColor");
                }
                if (_showNTFSFilesInColor)
                {
                    value = "1";
                }
                else
                {
                    value = "0";
                }

                if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                {
                    _checkWindowsExplorerFolderOptions.Add(true);
                }
                else
                {
                    _checkWindowsExplorerFolderOptions.Add(false);
                }
                #endregion


                foreach (bool b in _checkWindowsExplorerFolderOptions)
                {
                    if (!b)
                    {
                        totalcheck = false;
                        return(totalcheck);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Set Windows explorer folder options", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Set Windows explorer folder options", ex.Message));
            }

            return(totalcheck);
        }
Esempio n. 13
0
        public bool CheckRemoteDesktopSettings(OSVersions os, ConfigClass configClass)
        {
            bool totalcheck = true;

            try
            {
                string regPath = "";
                string regKey  = "";
                string value   = "";

                if (_remoteDesktopDisabled)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "1";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkRemoteDesktop.Add(true);
                    }
                    else
                    {
                        _checkRemoteDesktop.Add(false);
                    }
                    #endregion RegKeyRemoteDesktop

                    if (os != OSVersions.WindowsXP && os != OSVersions.WindowsXP32 && os != OSVersions.WindowsXP64 && os != OSVersions.W2003 && os != OSVersions.W2003R2)
                    {
                        #region RegPath Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        else
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        #endregion RegPath Netwerk level authentication
                        #region RegKeyRemoteDesktop Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        value = "0";
                        if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                        {
                            _checkRemoteDesktop.Add(true);
                        }
                        else
                        {
                            _checkRemoteDesktop.Add(false);
                        }
                        #endregion RegKeyRemoteDesktop Netwerk level authentication
                    }
                }
                if (_remoteDesktopEnabledForAllPCs && !_remoteDesktopEnabledOnlyForPCsWithNLA)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "0";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkRemoteDesktop.Add(true);
                    }
                    else
                    {
                        _checkRemoteDesktop.Add(false);
                    }

                    #endregion RegKeyRemoteDesktop

                    if (os != OSVersions.WindowsXP && os != OSVersions.WindowsXP32 && os != OSVersions.WindowsXP64 && os != OSVersions.W2003 && os != OSVersions.W2003R2)
                    {
                        #region RegPath Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        else
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        #endregion RegPath Netwerk level authentication
                        #region RegKeyRemoteDesktop Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        value = "0";
                        if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                        {
                            _checkRemoteDesktop.Add(true);
                        }
                        else
                        {
                            _checkRemoteDesktop.Add(false);
                        }
                        #endregion RegKeyRemoteDesktop Netwerk level authentication
                    }
                }
                if (_remoteDesktopEnabledForAllPCs && _remoteDesktopEnabledOnlyForPCsWithNLA)
                {
                    #region RegPath Enable/Disable
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath Enable/Disable
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "0";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkRemoteDesktop.Add(true);
                    }
                    else
                    {
                        _checkRemoteDesktop.Add(false);
                    }
                    #endregion RegKeyRemoteDesktop


                    #region RegPath Netwerk level authentication
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                    }
                    #endregion RegPath Netwerk level authentication
                    #region RegKeyRemoteDesktop Netwerk level authentication
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                    }
                    value = "1";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkRemoteDesktop.Add(true);
                    }
                    else
                    {
                        _checkRemoteDesktop.Add(false);
                    }
                    #endregion RegKeyRemoteDesktop Netwerk level authentication
                }

                if (configClass.GetScriptHandling.CheckIfUserinGroupExist(_remoteDesktopUsers))
                {
                    _checkRemoteDesktop.Add(true);
                }
                else
                {
                    _checkRemoteDesktop.Add(false);
                }
                //if (configClass.GetScriptHandling.CheckIfGroupInGroupExist(_remoteDesktopGroups))
                //{
                //  _checkRemoteDesktop.Add(true);
                //}
                //else
                //{
                //  _checkRemoteDesktop.Add(false);
                //}


                foreach (bool b in _checkRemoteDesktop)
                {
                    if (!b)
                    {
                        return(totalcheck);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Check remotedesktop settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Check remotedesktop settings", ex.Message));
            }
            return(totalcheck);
        }
Esempio n. 14
0
        //methods
        public void SetRemoteDesktopSettings(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath      = "";
                string regKey       = "";
                string value        = "";
                string propertyType = "DWORD";
                //string description = "";
                string group = "";
                #region language
                string oslanguage = System.Globalization.CultureInfo.CurrentCulture.DisplayName;
                if (oslanguage.Contains("Nederland"))
                {
                    group = "Externe bureaubladgebruikers";
                }
                else
                {
                    group = "Remote Desktop Users";
                }
                #endregion language

                if (_remoteDesktopDisabled)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "1";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyRemoteDesktop
                    if (os != OSVersions.WindowsXP && os != OSVersions.WindowsXP32 && os != OSVersions.WindowsXP64 && os != OSVersions.W2003 && os != OSVersions.W2003R2)
                    {
                        #region RegPath Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        else
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        #endregion RegPath Netwerk level authentication
                        #region RegKeyRemoteDesktop Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        value = "0";
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion RegKeyRemoteDesktop Netwerk level authentication
                    }
                }
                if (_remoteDesktopEnabledForAllPCs && !_remoteDesktopEnabledOnlyForPCsWithNLA)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "0";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyRemoteDesktop

                    if (os != OSVersions.WindowsXP && os != OSVersions.WindowsXP32 && os != OSVersions.WindowsXP64 && os != OSVersions.W2003 && os != OSVersions.W2003R2)
                    {
                        #region RegPath Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        else
                        {
                            regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                        }
                        #endregion RegPath Netwerk level authentication
                        #region RegKeyRemoteDesktop Netwerk level authentication
                        if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        else
                        {
                            regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                        }
                        value = "0";
                        configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                        #endregion RegKeyRemoteDesktop Netwerk level authentication
                    }
                }
                if (_remoteDesktopEnabledForAllPCs && _remoteDesktopEnabledOnlyForPCsWithNLA)
                {
                    #region RegPath Enable/Disable
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegPath");
                    }
                    #endregion RegPath Enable/Disable
                    #region RegKeyRemoteDesktop
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableLessSecureRegKey");
                    }
                    value = "0";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyRemoteDesktop


                    #region RegPath Netwerk level authentication
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegPath");
                    }
                    #endregion RegPath Netwerk level authentication
                    #region RegKeyRemoteDesktop Netwerk level authentication
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "RemoteDesktopEnableMoreSecureRegKey");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "RemoteDesktopEnableMoreSecureRegKey");
                    }
                    value = "1";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyRemoteDesktop Netwerk level authentication
                }
                if (_remoteDesktopGroups.Count != 0)
                {
                    foreach (RemoteDesktopGroup rdpGroup in _remoteDesktopGroups)
                    {
                        string trimmedRDPGroupName = rdpGroup.Name.Replace("\n", "").Trim();
                        configClass.GetScriptHandling.addGroupsToRemoteDesktopUsers(trimmedRDPGroupName);
                    }
                }
                if (_remoteDesktopUsers.Count != 0)
                {
                    foreach (RemoteDesktopUser rdpUser in _remoteDesktopUsers)
                    {
                        configClass.GetScriptHandling.AddUserToGroup(rdpUser.Name, group);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Set remotedesktop settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Set remotedesktop settings", ex.Message));
            }
        }
Esempio n. 15
0
 public MinVersionAttribute(OSVersions version)
 {
 }
        public void SetShutDownEventTracker(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath      = "";
                string regKey       = "";
                string value        = "";
                string propertyType = "DWORD";

                if (_shutDownEventTrackerInUse)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyShutdownReason
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyShutdownReason");
                    }
                    value = "1";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyShutdownReason
                    #region OnShutdownReasonUI
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    value = "1";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion OnShutdownReasonUI
                }
                else
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyShutdownReason
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyShutdownReason");
                    }
                    value = "0";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion RegKeyShutdownReason
                    #region OnShutdownReasonUI
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    value = "0";
                    configClass.GetScriptHandling.SetRegisterKey(regPath, regKey, value, propertyType);
                    #endregion OnShutdownReasonUI
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Set Shutdown event tracker", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Set Shutdown event tracker", ex.Message));
                ShutDownEventTrackerCheck = false;
            }
        }
 public static bool IsGreaterThan(this OperatingSystem os, OSVersions version)
 {
     return(os.Version.Build > (int)version);
 }
        public bool CheckSetShutDownEventTracker(OSVersions os, ConfigClass configClass)
        {
            try
            {
                string regPath = "";
                string regKey  = "";
                string value   = "";


                if (_shutDownEventTrackerInUse)
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyShutdownReason
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyShutdownReason");
                    }
                    value = "1";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkShutdownEventTracker.Add(true);
                    }
                    else
                    {
                        _checkShutdownEventTracker.Add(false);
                    }
                    #endregion RegKeyShutdownReason
                    #region OnShutdownReasonUI
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    value = "1";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkShutdownEventTracker.Add(true);
                    }
                    else
                    {
                        _checkShutdownEventTracker.Add(false);
                    }
                    #endregion OnShutdownReasonUI
                }
                else
                {
                    #region RegPath
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath") != null)
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegPath");
                    }
                    else
                    {
                        regPath = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegPath");
                    }
                    #endregion RegPath
                    #region RegKeyShutdownReason
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyShutdownReason");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyShutdownReason");
                    }
                    value = "0";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkShutdownEventTracker.Add(true);
                    }
                    else
                    {
                        _checkShutdownEventTracker.Add(false);
                    }
                    #endregion RegKeyShutdownReason
                    #region OnShutdownReasonUI
                    if (Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI") != null)
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(os, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    else
                    {
                        regKey = Actemium.WiSSWizard.Support.ResourceHelper.GetOSOperations(OSVersions.AllOS, "SDEVTRegKeyOnShutdownReasonUI");
                    }
                    value = "0";
                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkShutdownEventTracker.Add(true);
                    }
                    else
                    {
                        _checkShutdownEventTracker.Add(false);
                    }
                    #endregion OnShutdownReasonUI
                }

                foreach (bool b in _checkShutdownEventTracker)
                {
                    if (!b)
                    {
                        _shutDownEventTrackerCheck = false;
                        return(_shutDownEventTrackerCheck);
                    }
                }
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Shutdown eventtracker", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Shutdown eventtracker", ex.Message));
                ShutDownEventTrackerCheck = false;
            }
            return(_shutDownEventTrackerCheck);
        }
 public static bool IsAtLeast(this OperatingSystem os, OSVersions version)
 {
     return(os.Version.Build >= (int)version);
 }
Esempio n. 20
0
        public bool CheckAutoPlaySettings(OSVersions os, ConfigClass configClass)
        {
            bool totalcheck = true;

            try
            {
                string regPath = "";
                string regKey  = "";
                string value   = "";

                if (_autoPlayOff)
                {
                    #region All Drives
                    if (_autoPlaySetting == 1)
                    {
                        if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                        {
                            regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                        }
                        else
                        {
                            regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                        }
                        if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                        {
                            regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                        }
                        else
                        {
                            regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                        }
                        value = "255";
                        if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                        {
                            _checkAutoPlaySettings.Add(true);
                        }
                        else
                        {
                            _checkAutoPlaySettings.Add(false);
                        }
                    }
                    #endregion All Drives
                    #region CD-ROM drives
                    if (_autoPlaySetting == 0)
                    {
                        if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                        {
                            regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                        }
                        else
                        {
                            regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                        }
                        if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                        {
                            regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                        }
                        else
                        {
                            regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                        }
                        value = "181";

                        if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                        {
                            _checkAutoPlaySettings.Add(true);
                        }
                        else
                        {
                            _checkAutoPlaySettings.Add(false);
                        }
                    }
                    #endregion CD-ROM drives
                }
                else
                {
                    #region Disable
                    if (ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun") != null)
                    {
                        regKey = ResourceHelper.GetOSOperations(os, "APRegKeyNoDriveTypeAutoRun");
                    }
                    else
                    {
                        regKey = ResourceHelper.GetOSOperations(OSVersions.AllOS, "APRegKeyNoDriveTypeAutoRun");
                    }
                    if (ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath") != null)
                    {
                        regPath = ResourceHelper.GetOSOperations(os, "AutoPlaySettingRegPath");
                    }
                    else
                    {
                        regPath = ResourceHelper.GetOSOperations(OSVersions.AllOS, "AutoPlaySettingRegPath");
                    }

                    if (configClass.GetScriptHandling.CheckRegKeyExist(regPath, regKey, value))
                    {
                        _checkAutoPlaySettings.Add(false);
                    }
                    else
                    {
                        _checkAutoPlaySettings.Add(true);
                    }
                }

                foreach (bool b in _checkAutoPlaySettings)
                {
                    if (!b)
                    {
                        totalcheck = false;
                        return(totalcheck);
                    }
                }
                return(totalcheck);
            }
            #endregion Disable
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "Make autoplay settings", CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "Make autoplay settings", ex.Message));
                totalcheck = false;
                return(totalcheck);
            }
        }