Exemplo n.º 1
0
        public ModifyUser(string name, string fullname, string description, List <string> groupList, bool ChangePwNextLogon, bool PasswordCantBeChanged, bool PasswordNeverExpires, bool AccountDisabled, string password, CtrlHome ch, object[] comboBoxItems)
        {
            InitializeComponent();
            ConfigClass    _configClass    = new ConfigClass();
            ScriptHandling _scriptHandling = new ScriptHandling();
            int            indexForChecked = 0;

            foreach (string userGroupsString in _ctrlhome.localGroupMembers)
            {
                chkListBChangeGroups.Items.Add(userGroupsString);
                indexForChecked++;
                {
                    foreach (string checkedString in _ctrlhome.GroupsToBeChecked)
                    {
                        if (checkedString == userGroupsString)
                        {
                            chkListBChangeGroups.SetItemChecked(indexForChecked - 1, true);
                        }
                    }
                }
            }
            if (chkListBChangeGroups.CheckedItems.Count != 0)
            {
                foreach (string checkedItemsString in chkListBChangeGroups.CheckedItems)
                {
                    groupList.Add(checkedItemsString);
                }
            }
            lbUserName.Text                = name;
            tbUserFullName.Text            = fullname;
            tbUserDescription.Text         = description;
            tbNewPasword1.Text             = password;
            tbNewPasword2.Text             = password;
            cbChangePwNextLogon.Checked    = ChangePwNextLogon;
            cbPaswordCantBeChanged.Checked = PasswordCantBeChanged;
            cbPaswordNeverExpires.Checked  = PasswordNeverExpires;
            cbAccountDisabled.Checked      = AccountDisabled;
            _ctrlhome = ch;
        }
Exemplo n.º 2
0
        public void GetAllNic()
        {
            const string FUNCTIONNAME = "GetAllNic";

            Trace.WriteVerbose("()", FUNCTIONNAME, CLASSNAME);
            ScriptHandling _sh = new ScriptHandling();

            _sh.ShowCurrentIPSetting();
            foreach (string currentIpString in _sh.ShowAllCurrentIPSettings)
            {
                if (currentIpString.Contains(NICNAME))
                {
                    int    seperationIndex = currentIpString.IndexOf("[");
                    string captionInit     = currentIpString.Substring(0, seperationIndex);
                    string captionName     = currentIpString.Substring(seperationIndex, currentIpString.Length - captionInit.Length);
                    if (captionName.Contains("\r"))
                    {
                        captionName = captionName.Substring(0, captionName.Length - 1);
                    }
                    _captionList.Add(captionName);
                }
            }
        }
Exemplo n.º 3
0
 public ConfigClass()
 {
     _scriptHandling          = new ScriptHandling(this);
     _defaultInformation      = new DefaultInformation();
     _installedSoftware       = new InstalledSoftware();
     _passwordPolicy          = new PasswordPolicy();
     _auditPolicy             = new AuditPolicy();
     _windowsUsergroup        = new WindowsUsergroup();
     _windowsUsers            = new WindowsUsers(this);
     _autoPlaySettings        = new AutoPlaySettings();
     _windowsExplorerSettings = new WindowsExplorerSettings();
     _loginShutdownSettings   = new LoginShutdownSettings();
     _remotedesktop           = new Remotedesktop();
     _windowsFirewall         = new WindowsFirewall();
     _sqlConfigure            = new SQLServer();
     _setNetwork       = new SetNetwork();
     _newNetwork       = new NewNetwork();
     _webServer        = new WebServer();
     _confSetFTPServer = new NewFTPServer();
     _sharedFolder     = new SharedFolder();
     _microsoftBaslineSecurityAnalyzer     = new MicrosoftBaslineSecurityAnalyzer();
     _createStartupProcessForOtherAccounts = new CreateStartupProcessForOtherAccounts();
 }
Exemplo n.º 4
0
        public void GetAllCurrentWindowsSettings(ConfigClass configClass)
        {
            const string FUNCTIONNAME = "GetAllCurrentWindowsSettings";

            try
            {
                Trace.WriteVerbose("()", FUNCTIONNAME, CLASSNAME);
                ScriptHandling _sh = new ScriptHandling();
                _sh.ShowCurrentWindowsSettings();

                foreach (string str in _sh.ShowAllCurrentWindowsSettings)
                {
                    int    seperationIndex      = str.IndexOf(":");
                    string windowsSettingsName  = str.Substring(0, seperationIndex + 1);
                    string windowsSettingsValue = str.Substring(seperationIndex + 1, str.Length - seperationIndex - 1);
                    bool   windowsValue         = false;
                    int    temp = 0;

                    switch (windowsSettingsName)
                    {
                    case AUTOPLAY:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        AutoplayCD = windowsValue;
                        break;

                    case SHOW_THE_CONTENT_OF_SYSTEM_FOLDER:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        DisplayContentOfSystemFolder = windowsValue;
                        break;

                    case DISPLAY_THE_FULL_PATH_IN_THE_ADDRESS_BAR:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        DisplayFullPathInAddressBar = windowsValue;
                        break;

                    case SHOW_HIDDEN_FILES_AND_FOLDERS:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        ShowHiddenFolders = windowsValue;
                        break;

                    case AUTOMATIC_SEARCH_FOR_NETWORK_FOLDERS_AND_PRINTERS:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        AutomaticallySearchNetworkFoldersAndPrinters = windowsValue;
                        break;

                    case HIDE_FILE_EXTENSIONS:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        HideExtensions = windowsValue;
                        break;

                    case SHOW_SYSTEM_FILES_AND_FOLDERS:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        HideProtectedOSFiles = windowsValue;
                        break;

                    case THE_VIEW_SETTINGS_FOR_EACH_FOLDER:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        RememberEachFoldersViewSetting = windowsValue;
                        break;

                    case SHOW_ENCRYPTED_OR_COMPRESSED_NTFS_FILES_IN_COLOR:
                        temp = int.Parse(windowsSettingsValue);
                        switch (temp)
                        {
                        case 0:
                            windowsValue = false;
                            break;

                        case 1:
                            windowsValue = true;
                            break;
                        }
                        ShowNTFSFilesInColor = windowsValue;
                        break;

                    default:
                        Trace.WriteInformation("'{0}' is not a supported value for Windows Settings", FUNCTIONNAME, CLASSNAME, windowsSettingsName);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.WriteError("()", FUNCTIONNAME, CLASSNAME, ex);
                configClass.ErrorList.Add(new ConfigErrors(CLASSNAME, "GetAllAuditPolicy", ex.Message));
            }
        }