Beispiel #1
0
 public AdTasks(TargInfo t)
 {
     targ       = t;
     connection = t.host.connection;
     local      = t.local;
     user       = t.host.user;
 }
Beispiel #2
0
 private void CreateTargInfoObject()
 {
     //Abstract Data Object - shared by most classes.
     //See TargInfo.cs for more info
     targ = new TargInfo(this);
     //Subclasses contained within TargInfo.cs
     //simplifies fetching data and calling methods
     connection = targ.host.connection;
     local      = targ.local;
     user       = targ.host.user;
 }
Beispiel #3
0
        public DevTools(TargInfo t)
        {
            InitializeComponent();
            targDev    = t;
            connection = t.host.connection;
            local      = t.local;
            user       = t.host.user;

            #region commandList List<string>

            CommandList = new List <string>
            {
                "Rights Exist on Host? (LDAP)",
                "Rights Exist on Host? (WMI)",
                "List Admins on Host (LDAP)",
                "List Admins on Host (WMI)",
                "Get Host Info (SCRIPT)",
                "Get Host Info (WMI)",
                "User Exists in AD?",
                "Add Test Admins"
            };
            comboBox2.DataSource = CommandList;

            #endregion

            #region dataGridHostInfo Rows / Cols

            dataGridHostInfo.Rows.Add("AdminRightsExist");
            dataGridHostInfo.Rows.Add("CurrentUser");
            dataGridHostInfo.Rows.Add("EndDate");
            dataGridHostInfo.Rows.Add("EndTime");
            dataGridHostInfo.Rows.Add("HostIP");
            dataGridHostInfo.Rows.Add("HostLocale");
            dataGridHostInfo.Rows.Add("HostName");
            dataGridHostInfo.Rows.Add("HostTime");
            dataGridHostInfo.Rows.Add("LocalTime");
            dataGridHostInfo.Rows.Add("UserID");
            dataGridHostInfo.Rows.Add("UserFullName");
            dataGridHostInfo.Rows.Add("UserIDExists");
            dataGridHostInfo.Rows.Add("IsWmiActive");

            dataGridHostInfo.RowHeadersVisible = false;
            dataGridHostInfo.ScrollBars        = ScrollBars.None;

            #endregion

            #region Populate form fields

            //If IP not blank copy IP from Main Form
            txtIP.Text   = targDev.mainForm.GetTxtHostIP != string.Empty ? targDev.mainForm.GetTxtHostIP : "127.0.0.1";
            txtUser.Text = targDev.mainForm.GetTxtUserID != string.Empty ? targDev.mainForm.GetTxtUserID : Environment.UserName;
            #endregion
        }
Beispiel #4
0
 public RemoteTasks(TargInfo t)
 {
     targ        = t;
     connection  = t.host.connection;
     local       = t.local;
     user        = t.host.user;
     jobFilePath = string.Format(@"\\{0}\C$\Windows\Tasks\{1}.job",
                                 connection.HostIP,
                                 user.UserID);
     targInfoPath = string.Format(@"\\{0}\C$\Windows\System32\targinfo.txt",
                                  connection.HostIP);
 }
Beispiel #5
0
        public TargLogs(TargInfo t)
        {
            connection = t.host.connection;
            local      = t.local;
            user       = t.host.user;
            targ       = t;

            //Create log paths///
            string errorLogDir  = @"C:\Temp\Targ\ErrorLogs";
            string rightsLogDir = @"C:\Temp\Targ\Rights";

            if (!Directory.Exists(errorLogDir))
            {
                Directory.CreateDirectory(errorLogDir);
            }

            if (!Directory.Exists(rightsLogDir))
            {
                Directory.CreateDirectory(rightsLogDir);
            }
            /////////////////////

            if (!Util.ValidationCheck.isTestEnvironment()) //Production
            {
                errorLogPath = string.Format(
                    @"\\" + LOGHOST + @"\c$\Temp\Targ\ErrorLogs\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));

                rightsLogPath = string.Format(
                    @"\\" + LOGHOST + @"\c$\Temp\Targ\Rights\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));
            }
            #region TEST ENVIRONMENT
            else //Test
            {
                errorLogPath = string.Format(
                    @"c:\Temp\Targ\ErrorLogs\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));

                rightsLogPath = string.Format(
                    @"c:\Temp\Targ\Rights\{0} - {1}.txt",
                    Environment.UserName, DateTime.Now.ToString(DateTimeFormat));
            }
            #endregion
        }