private void ButtonBenutzerLaden_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; DataGridViewBenutzer.Rows.Clear(); List <string> serverListe = new List <string>(); foreach (DataGridViewRow row in DataGridViewServer.Rows) { if ((bool)row.Cells[0].Value == true && row.Visible) { serverListe.Add(row.Cells[1].Value.ToString()); } } List <List <string> > liste = SessionVerwaltung.QUser(serverListe); foreach (List <string> linie in liste) { if (linie[1].Trim() != "BENUTZERNAME") { if (linie[2].Trim().StartsWith("rdp")) { DataGridViewBenutzer.Rows.Add(false, linie[0], linie[1], linie[3], linie[4]); } else { DataGridViewBenutzer.Rows.Add(false, linie[0], linie[1], linie[2], linie[3]); } } } Cursor.Current = Cursors.Default; }
private void ButtonSitzungSpiegeln_Click(object sender, EventArgs e) { List <List <string> > Users = new List <List <string> >(); foreach (DataGridViewRow row in DataGridViewBenutzer.Rows) { if ((bool)row.Cells[0].Value == true && row.Visible) { Users.Add(new List <string> { row.Cells[1].Value.ToString(), row.Cells[3].Value.ToString(), row.Cells[2].Value.ToString() }); } } if (Users.Count > 0) { if (MessageBox.Show($"Wirklich {Users.Count} Sitzungen spiegeln?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { SessionVerwaltung.ShadowSession(Users); } } }
private void ButtonLogin_Click(object sender, EventArgs e) { ButtonLogin.Enabled = false; labelWrongPW.Text = string.Empty; if (SessionVerwaltung.ADAuthentication("vrg-ol.de", TextBoxUsername.Text, TextBoxPassword.Text)) { form1.username = TextBoxUsername.Text; form1.passwort = TextBoxPassword.Text; this.Close(); } else { MessageBox.Show("Authentifizierung fehlgeschlagen", "Warnung", MessageBoxButtons.OK, MessageBoxIcon.Warning); labelWrongPW.Text = " Falsches PW"; TextBoxPassword.Text = string.Empty; TextBoxPassword.Focus(); } ButtonLogin.Enabled = true; }
private void ButtonVerbinden_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; List <string> serverListe = new List <string>(); foreach (DataGridViewRow row in DataGridViewServer.Rows) { if ((bool)row.Cells[0].Value == true && row.Visible) { serverListe.Add(row.Cells[1].Value.ToString()); } } if (!string.IsNullOrEmpty(username)) { SessionVerwaltung.CreateCMDKey(serverListe, username, passwort); } SessionVerwaltung.Mstsc(serverListe); Cursor.Current = Cursors.Default; }