Exemplo n.º 1
0
        public async Task ProfileWipe_Disable()
        {
            Processing++;
            var remove1 = new Tool.StandardProcess(@"c:\windows\system32\", "schtasks.exe", @"/delete /s \\" + IPAddress.ToString() + @" /tn ""Profile wipe"" /f");
            var remove2 = new Tool.StandardProcess(@"c:\windows\system32\", "schtasks.exe", @"/delete /s \\" + IPAddress.ToString() + @" /tn ""remove wipe"" /f");
            await remove1.Run();

            await remove2.Run();

            Processing--;
            Log(log.Info, "Profile Wipe DISABELED");
        }
Exemplo n.º 2
0
        public async Task <bool> OpenHDrive()
        {
            Log(log.Info, "Opening H drive for {0}", CurrentUser);
            try
            {
                var sp = new Tool.StandardProcess(@"c:\Windows\", "explorer", @"\\fs2\students\" + CurrentUser);
                await sp.Run();

                return(true);
            }
            catch (Exception ex)
            {
                Log(log.Error, ex.ToString());
                return(false);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Used to launch explorer of the remote machine c share
        /// </summary>
        /// <returns>Returns false if cshare cannot be opened.</returns>
        public async Task <bool> OpenCShare()
        {
            Processing++;
            Log(log.Info, "Opening C-Share");
            try
            {
                var sp = new Tool.StandardProcess(@"c:\Windows\", "explorer.exe", @"\\" + IPAddress.ToString() + @"\c$\");
                await sp.Run();

                Processing--;
                return(true);
            }
            catch (Exception ex)
            {
                Log(log.Error, ex.ToString());
                Processing--;
                return(false);
            }
        }
Exemplo n.º 4
0
        public async Task ProfileWipe_Enable()
        {
            Processing++;

            var UserProfileServiceFix = new Tool.PAExec(IPAddress, @"-accepteula -realtime -s icacls c:\Users\Default\*  /inheritance:e /T /C");
            await UserProfileServiceFix.Run();

            var file = new Tool.Files();

            file.EventLogged += PassEventLogged;
            await Task.Run(() => file.Copy(@"\\fs1\HelpDesk\TOOLS\3rdParty\Delprof2 1.5.4", string.Format(@"\\{0}\c$\temp\Delprof2_1.5.4\", IPAddress)));

            file.EventLogged -= PassEventLogged;

            var add1 = new Tool.StandardProcess(@"c:\windows\system32\", "schtasks.exe", string.Format(@"/create /s \\{0} /sc onstart /delay 0000:10 /rl HIGHEST /ru SYSTEM /tn ""Profile wipe"" /tr ""c:\temp\Delprof2_1.5.4\delprof2.exe /u /id:{1}""", IPAddress.ToString(), CurrentUser));
            var add2 = new Tool.StandardProcess(@"c:\windows\system32\", "schtasks.exe", @"/create /s \\" + IPAddress.ToString() + @"  /sc onlogon /ru SYSTEM /tn ""remove wipe"" /tr ""c:\temp\Delprof2_1.5.4\remove.bat""");
            await add1.Run();

            await add2.Run();

            Processing--;
            Log(log.Info, "Profile Wipe ENABELED on next boot.");
        }