Guest LoriP Posted August 9, 2007 Posted August 9, 2007 I have Windows XP Tablet Edition, SP2. I'm logged on to a domain as one user, but need to run the scheduled task as a different user. I have the task set up to run a batch file. The first line of the batch file is "taskkill GTViewer.exe /f," the next lines copy and unzip files, then the last line starts GTViewer in maximized mode. The batch file runs successfully when executed outside the task. It also runs successfully when I open a command prompt as another user. When I schedule a task and set the RunAs to DOMAIN\00000111 (and enter the password), the file runs but it doesn't open GTViewer; I'm logged on as 99999999@DOMAIN. 00000111 is an administrator on the PC. It shows the process GTViewer.exe running in Task Manager, but the application window doesn't open. The task runs properly if I run it as the same person who is logged on (that is, GTViewer opens in a full window). Any help or suggestions would be appreciated. I've not found this type of problem documented anywhere.
Guest Pegasus \(MVP\) Posted August 9, 2007 Posted August 9, 2007 Re: Scheduled Task runas: "LoriP" <LoriP@discussions.microsoft.com> wrote in message news:567A4A9E-D46D-4DC4-B423-7BD6D114C716@microsoft.com... >I have Windows XP Tablet Edition, SP2. I'm logged on to a domain as one > user, but need to run the scheduled task as a different user. I have the > task set up to run a batch file. The first line of the batch file is > "taskkill GTViewer.exe /f," the next lines copy and unzip files, then the > last line starts GTViewer in maximized mode. The batch file runs > successfully when executed outside the task. It also runs successfully > when > I open a command prompt as another user. When I schedule a task and set > the > RunAs to DOMAIN\00000111 (and enter the password), the file runs but it > doesn't open GTViewer; I'm logged on as 99999999@DOMAIN. 00000111 is an > administrator on the PC. It shows the process GTViewer.exe running in > Task > Manager, but the application window doesn't open. The task runs properly > if > I run it as the same person who is logged on (that is, GTViewer opens in a > full window). > > Any help or suggestions would be appreciated. I've not found this type of > problem documented anywhere. Scheduled tasks are meant to be run in the background, not in the foreground. You can interact with them in the foreground if you make them run under the same account as your foreground logon account. If they run under a different account then any interaction with the foreground session is prohibited. If it was allowed then this would create an immediate security issue: The foreground session could use/abuse the privileges of the account used for the background session.
Guest LoriP Posted August 9, 2007 Posted August 9, 2007 Re: Scheduled Task runas: Thank you. I was assuming I couldn't do what I wanted since I tried everything I could think of, but needed verification. "Pegasus (MVP)" wrote: > > "LoriP" <LoriP@discussions.microsoft.com> wrote in message > news:567A4A9E-D46D-4DC4-B423-7BD6D114C716@microsoft.com... > >I have Windows XP Tablet Edition, SP2. I'm logged on to a domain as one > > user, but need to run the scheduled task as a different user. I have the > > task set up to run a batch file. The first line of the batch file is > > "taskkill GTViewer.exe /f," the next lines copy and unzip files, then the > > last line starts GTViewer in maximized mode. The batch file runs > > successfully when executed outside the task. It also runs successfully > > when > > I open a command prompt as another user. When I schedule a task and set > > the > > RunAs to DOMAIN\00000111 (and enter the password), the file runs but it > > doesn't open GTViewer; I'm logged on as 99999999@DOMAIN. 00000111 is an > > administrator on the PC. It shows the process GTViewer.exe running in > > Task > > Manager, but the application window doesn't open. The task runs properly > > if > > I run it as the same person who is logged on (that is, GTViewer opens in a > > full window). > > > > Any help or suggestions would be appreciated. I've not found this type of > > problem documented anywhere. > > Scheduled tasks are meant to be run in the background, not > in the foreground. You can interact with them in the foreground > if you make them run under the same account as your foreground > logon account. If they run under a different account then any > interaction with the foreground session is prohibited. If it was > allowed then this would create an immediate security issue: > The foreground session could use/abuse the privileges of the > account used for the background session. > > >
Recommended Posts