Exemplo n.º 1
0
        protected override void Run()
        {
            Process proc = new Process();

            proc.StartInfo.UserName = AdminAccounts.GetAdminAccount1().UserName;
            SecureString secure = AdminAccounts.GetAdminAccount1().SecurePassword;

            proc.StartInfo.Domain                 = Domain.GetDomain();
            proc.StartInfo.Password               = secure;
            proc.StartInfo                        = new ProcessStartInfo(@"cmd.exe", String.Format(@"/c installIDF.cmd {0}", _comp.IPAddress));
            proc.StartInfo.WorkingDirectory       = @"C:\Manage\IdentityFinder";
            proc.StartInfo.UseShellExecute        = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.RedirectStandardError  = true;
            //proc.EnableRaisingEvents = true;
            proc.OutputDataReceived += (sender, args) => UpdateStatus(args.Data);
            proc.ErrorDataReceived  += (sender, args) => UpdateStatus(args.Data);

            noErrorCount = 0;

            proc.Start();
            proc.BeginOutputReadLine();
            proc.BeginErrorReadLine();
            proc.WaitForExit(60);
        }
Exemplo n.º 2
0
        protected override void Run()
        {
            Process proc = new Process();

            proc.StartInfo.UserName = AdminAccounts.GetAdminAccount1().UserName;
            proc.StartInfo.Password = AdminAccounts.GetAdminAccount1().SecurePassword;

            proc.StartInfo.Domain = Domain.GetDomain();
            if (_comp.USMTGID != "aulease")
            {
                proc.StartInfo = new ProcessStartInfo(@"cmd.exe", String.Format(@"/c schedUSMT.cmd {0} {1} {2}", _comp.IPAddress, _comp.USMTGID, _comp.NewIPAddress));
            }
            else
            {
                proc.StartInfo = new ProcessStartInfo(@"cmd.exe", String.Format(@"/c schedUSMTasAULease.cmd {0} {1}", _comp.IPAddress, _comp.NewIPAddress));
            }
            proc.StartInfo.WorkingDirectory       = @"C:\Manage\USMT";
            proc.StartInfo.UseShellExecute        = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.RedirectStandardError  = true;
            proc.EnableRaisingEvents = true;
            proc.OutputDataReceived += (sender, args) => UpdateStatus(args.Data);
            proc.ErrorDataReceived  += (sender, args) => UpdateStatus(args.Data);

            noErrorCount = 0;

            proc.Start();
            proc.BeginOutputReadLine();
            proc.BeginErrorReadLine();
            proc.WaitForExit(60);
        }