Question

The code below should attempt a connections to one of the servers in my list. My question is will trying all these combinations lockout the accounts?

uid = some1 pwd = 1thing

private void connect_all()
    {
        // Test
        string connstr;
        string[] idt =  {"-reu","-ram","-rar"};

        uid = textBox1.Text;
        pwd = textBox2.Text;
        ConnectionOptions options = new ConnectionOptions();
        options.Password = pwd;

        for (int i = 0; i < servers.Count; i++)
        {
            connstr = "\\\\" + servers[i].server + "\\root\\cimv2";
            for (int y = 0; y < idt.Length; y++)
            {
                options.Username = "-adm-" + uid + idt[y];
                try
                {
                    ManagementScope scope = new ManagementScope(connstr, options);
                    scope.Connect();
                    MessageBox.Show("Connect");
                }
                catch (Exception Ex)
                {
                    MessageBox.Show(Ex.Message);
                }
            }
        }

    }
Was it helpful?

Solution

Yes, connecting with MangementScope will lock out a account.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top