private void lstView_Click(object sender, EventArgs e) { Application.DoEvents(); try { lstNetworkDevices.Items.Clear(); lstIPAddress.DataSource = null; lstStorage.Items.Clear(); lstSoftware.Items.Clear(); SelectedMachineName = lstView.SelectedItems[0].SubItems[1].Text; if (DomainProvider.GetInstance().IsDomainAdministrator || Dns.GetHostName() == SelectedMachineName) { InitCursor(); GetListofSofwares(); PopulateNetworkDevices(); FillStorage(); ResetCursor(); } else { MessageBox.Show("Please login as domain admin to see other system details"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public ActionResult Scan() { var loggedInUser = User.Identity.Name.Split('\\')[1]; var domain = DomainProvider.GetInstance().EnumerateDomains(loggedInUser); var machines = NetworkProvider.GetInstance().DomainNetworkComputers(domain.FirstOrDefault()); return(View(machines)); }
private void PopulateDomain() { var loggedinUser = WindowsIdentity.GetCurrent().Name.Split('\\')[1]; var domains = DomainProvider.GetInstance().EnumerateDomains(loggedinUser); lblDomain.Text = string.Format("Domain({0})", domains.Count); lstDomain.DataSource = domains; SelectedDomain = domains.FirstOrDefault(); }