Schedule Task Security in Windows Server 2003

C

cct

Dear all,

I am confuse with ASP.net security in related to Windows Scheduler.

My server setting:-
Windows Server 2003 + SP1
dotnet framework 1.1 + SP1

web.config:-
<authentication mode="Windows" />
<identity impersonate="true" />

IIS Authentication Method:-
Integrated Windows Authentication (ONLY!)

My sample code:-

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "schtasks.exe";
psi.Arguments =@" /query /fo csv /nh /v";
psi.UseShellExecute = false;
psi.WindowStyle=ProcessWindowStyle.Hidden;
psi.RedirectStandardOutput = true;

Process process = Process.Start(psi);
string szScheduleList = process.StandardOutput.ReadToEnd();
process.Close();

Where szScheduleList return empty. (Login as local administrator or
Environment.UserName=Administrator)
But the same code is running fine in Windows XP+SP2 environment.


Any help is highly appreciated.
Thanks.
 
M

[MSFT]

Hello,

I tested yourr code but I got correct result on a Windows 2003 Server. The
account I used is a domain account but in local administrators group. I
suggest you may add following line in your ASPX page:

Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);

to verify the account your ASP.NET app used.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top