<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx</link><description>I finally have enough blog entries about various portions of IIS6 request processing that I can stitch together this meta-blog-entry explaining how it all works together and then apply it towards an issue. You probably want to keep a link to this loaded</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586070</link><pubDate>Fri, 28 Apr 2006 19:10:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586070</guid><dc:creator>jvierra</dc:creator><description>That was teh best short explanation of how it all works that I have ever seen. &amp;nbsp;I think, for the first time, &amp;nbsp;I understand all of to pieces.&lt;br&gt;&lt;br&gt;You should save this and post it somewhere obvious.&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586327</link><pubDate>Fri, 28 Apr 2006 23:27:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586327</guid><dc:creator>David.Wang</dc:creator><description>jvierra - thanks for the suggestion. I am planning to do that with this post because it lays down the foundation for understanding how request processing works on IIS6 - it is rather straight forward once you see it all - and should help in understanding how to configure and troubleshoot it, too.&lt;br&gt;&lt;br&gt;I will probably make additions to it as time goes on (there are still tons of interesting details missing), as new posts, etc...&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586364</link><pubDate>Sat, 29 Apr 2006 00:16:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586364</guid><dc:creator>jvierra</dc:creator><description>IIS has always been somewhat poorly documented with MS seaming to go for web site and business apps and not providing in-depth technical information about how IIS works under the covers.&lt;br&gt;&lt;br&gt;I have been using IIS since it first debuted. &amp;nbsp;I have found that, once you get to know it it is really quite simple.&lt;br&gt;&lt;br&gt;Except when I have to do something extra. &amp;nbsp;esterday I needed to set up a scond SSL site on a WS2003 SP1 server and relaized that there is no way to specify a header value.&lt;br&gt; &amp;nbsp;Looking at teh IIS manager page I thought that ther must be a way to do this. &amp;nbsp;I though - maybe MetaDat Editor???&lt;br&gt;&lt;br&gt;I also had just discovered the following webcast. &amp;nbsp;Who knew?&lt;br&gt;&lt;br&gt;TechNet Webcast: Using Host Headers with SSL-Enabled Web Sites in IIS 6&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="https://msevents.microsoft.com/cui/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032280959&amp;amp;EventCategory=5.0"&gt;https://msevents.microsoft.com/cui/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032280959&amp;amp;EventCategory=5.0&lt;/a&gt; (Level 200)</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586386</link><pubDate>Sat, 29 Apr 2006 00:52:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586386</guid><dc:creator>Maurits</dc:creator><description>the leading-newline problem could be worked around by using a batch file. &amp;nbsp;Consider:&lt;br&gt;&lt;br&gt;:: net.bat ::&lt;br&gt;@echo off&lt;br&gt;&lt;br&gt;rem issue a blank line to terminate the headers&lt;br&gt;echo.&lt;br&gt;&lt;br&gt;rem run &amp;quot;net.exe&amp;quot; with the arguments supplied to net-iis.bat&lt;br&gt;net.exe %*&lt;br&gt;&lt;br&gt;rem Don't leave off the &amp;quot;.exe&amp;quot; above or you'll infinitely recurse!</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586398</link><pubDate>Sat, 29 Apr 2006 01:10:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586398</guid><dc:creator>jvierra</dc:creator><description>Well, as long as we are going to use scripts how would using this work:&lt;br&gt;&lt;br&gt;set objShell = Server.CreateObject( &amp;quot;WScript.Shell&amp;quot; )&lt;br&gt;objShell.Exec( &amp;quot;FSUTIL.EXE&amp;quot; )&lt;br&gt;&lt;br&gt;while not input = &amp;quot;someline&amp;quot;&lt;br&gt; &amp;nbsp; &amp;nbsp;input = objShell.Readln()&lt;br&gt;wend&lt;br&gt;&lt;br&gt;Do what you need with reformatting the lines and sending them to the browser.&lt;br&gt;&lt;br&gt;This would avoid some issues but is still not the easiest way to set up.&lt;br&gt;&lt;br&gt;I would try and build everyting in script embedded in the ASP web page. &amp;nbsp;All of the commands listed can have script couterparts. &amp;nbsp;You would need to run the web application at an elevated privilege or only allow admins to use it. &amp;nbsp;All things like quotas and such are available from either AD or from WMI.&lt;br&gt;&lt;br&gt;I would also consider using NET 2.0 as it has access to the system management objects and can be made to work in a web application.&lt;br&gt;&lt;br&gt;The only issue I have found with this is that the web server cannot access other hosts under any circumstances without being allowed to delegate.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586578</link><pubDate>Sat, 29 Apr 2006 09:34:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586578</guid><dc:creator>David.Wang</dc:creator><description>jvierra - I agree. IIS has long been a platform that played second-viola to all the other Microsoft Servers. See:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2006/04/13/IIS7_Product_or_Platform.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2006/04/13/IIS7_Product_or_Platform.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;Yes, with Windows Server 2003 SP1, you can use SSL with Host headers, with the obvious caveats:&lt;br&gt;- For a given IP:Port which varies by Host header, the SAME SSL Server Certificate must be returned (remember, we still need the Host header to determine the right website's Server Certificate to use for SSL, but we need to negotiate SSL to first decrypt and obtain the Host header)&lt;br&gt;- Since Certificate Authorities cannot give out wildcard domain SSL Server Certificates, you cannot use this to host *.com domains. However, subdomains should be easy (subA.domain.com and subB.domain.com).&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586585</link><pubDate>Sat, 29 Apr 2006 09:44:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586585</guid><dc:creator>David.Wang</dc:creator><description>maurits - Details, details... :-)&lt;br&gt;&lt;br&gt;Since .bat is not recognized by IIS as an executable extension, it is really the same as ASP from an IIS-perspective (i.e. it is a ScriptMapped scenario).&lt;br&gt;&lt;br&gt;In particular, .bat extension has to be ScriptMapped to CMD.EXE to function, and CMD.EXE has extremely tight security checks and is a huge additional dependency that is not present in the simple &amp;quot;run NET.EXE as a CGI by IIS&amp;quot; use.&lt;br&gt;&lt;br&gt;However, the nice thing is that the .bat file is executed under CreateProcessAsUser().&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586590</link><pubDate>Sat, 29 Apr 2006 10:00:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586590</guid><dc:creator>David.Wang</dc:creator><description>jvierra - The approach of executing FSUTIL.EXE with objShell.Exec() would execute FSUTIL.EXE using CreateProcess(), which uses the process identity and not impersonated identity. This means that if you:&lt;br&gt;1. configure the Application Pool to be Network Service&lt;br&gt;2. enable authentication &lt;br&gt;3. an Administrator logs in to run this ASP page&lt;br&gt;&lt;br&gt;It STILL gets run as &amp;quot;Network Service&amp;quot; instead of Administrator - probably not what you expected.&lt;br&gt;&lt;br&gt;Meanwhile, if you use ADSI/WMI from Script, they would most likely use the impersonated identity (unless the code internally does RevertToSelf()).&lt;br&gt;&lt;br&gt;I am not certain that .NET 2.0 makes it any easier/better because System.Management is just a managed code layer sitting on top of WMI, which is all native code.&lt;br&gt;&lt;br&gt;RE: delegation - that has NOTHING to do with the web server nor technology and everything to do with security basics. Just because I authenticated to the web server to execute an ASPX page does NOT mean the web server can take and use my identity to contact my bank electronically and withdraw my money from my bank account as ME.&lt;br&gt;&lt;br&gt;Also read this blog entry:&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2005/07/06/SSO_ISAPI_Considerations_2.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2005/07/06/SSO_ISAPI_Considerations_2.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586656</link><pubDate>Sat, 29 Apr 2006 15:28:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586656</guid><dc:creator>jvierra</dc:creator><description>David - &lt;br&gt;&lt;br&gt;According to the Webcast wildcard certificates CAN be used with SP1. &amp;nbsp;I am just getting ready to try this on a test server. &amp;nbsp;Somtime next week I hope.&lt;br&gt;&lt;br&gt;Part of the main theme of the webcast is &amp;quot;using wildcard certs&amp;quot; for cross site security.&lt;br&gt;&lt;br&gt;Is it possible the the Webcast is wrong. &amp;nbsp;The demo appears to work.&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586683</link><pubDate>Sat, 29 Apr 2006 15:50:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586683</guid><dc:creator>jvierra</dc:creator><description>David - My point with using WMI/ADSI is that it is easier to manage the code ubder ASP and can execute in the users security context for MOST things that admins want to see. &amp;nbsp;&lt;br&gt;&lt;br&gt;Two problems come up when trying this.&lt;br&gt;&lt;br&gt;1. &amp;nbsp;Non-admin users can't execute most WMI and some ADSI requests.&lt;br&gt;2. &amp;nbsp;WMI queries against remote machines will only work if the IIS machine is &amp;quot;Trusted for Delegation&amp;quot; in AD.&lt;br&gt;&lt;br&gt;Of course if you run the web site under administrative credentials some of these things can be circumvented but that is never a good choise in my mind.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#586690</link><pubDate>Sat, 29 Apr 2006 16:05:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586690</guid><dc:creator>jvierra</dc:creator><description>ADDENDUM to previous comment:&lt;br&gt;&lt;br&gt;For clarity I want to add that this will only work WITHIN the domain and using &amp;nbsp;&amp;quot;Integrated Security&amp;quot;.&lt;br&gt;&lt;br&gt;David - your blog on SSO/XAPI was excellent and should be helpful in settling issues of &amp;quot;how&amp;quot; and &amp;quot;why&amp;quot; authentication works and doesn't work.</description></item><item><title>Interesting Finds (oS edition) 2006/04/28</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#587396</link><pubDate>Mon, 01 May 2006 09:55:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:587396</guid><dc:creator>Jason Haley</dc:creator><description /></item><item><title>HOWTO: Access POST form data with ISAPI</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#595208</link><pubDate>Thu, 11 May 2006 11:39:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:595208</guid><dc:creator>David Wang</dc:creator><description>This is a frequently asked question about IIS6 extensibility - how to access the request entity body...</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#597361</link><pubDate>Sun, 14 May 2006 14:10:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597361</guid><dc:creator>PL</dc:creator><description>Not sure why this blog is so classic ASP centered, this and most things today is best solved with ASP.NET.&lt;br&gt;&lt;br&gt;For example to launch processes on the server and retrieve the result you simply do this:&lt;br&gt;&lt;br&gt;1. Make sure the ASPNET user has enough priviliges, meaning if you want to copy files or anything you need to set that up on the server.&lt;br&gt;&lt;br&gt;2. Some programs require desktop access, to enable this for ASP.NET worker processes double click the WWW publishing service and under Logon check the box that says &amp;quot;allow interaction with desktop&amp;quot;. If the process doesnt launch at all this is the thing you need to do.&lt;br&gt;&lt;br&gt;3. Use a page like this:&lt;br&gt;&lt;br&gt;&amp;lt;%@ Page LANGUAGE=&amp;quot;C#&amp;quot; CODEPAGE=&amp;quot;65001&amp;quot;%&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.Diagnostics&amp;quot; %&amp;gt;&lt;br&gt;&amp;lt;%@ Import Namespace=&amp;quot;System.IO&amp;quot; %&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;script language=&amp;quot;C#&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br&gt;&lt;br&gt;protected void RunCommand(object sender, EventArgs e)&lt;br&gt;{	&lt;br&gt;	string sCommandTool = @&amp;quot;E:\daten\batch\test.cmd&amp;quot;;&lt;br&gt;	string sCommandArguments = &amp;quot;&amp;quot;;&lt;br&gt;&lt;br&gt;	string sOutput = &amp;quot;&amp;quot;;&lt;br&gt;&lt;br&gt;	try&lt;br&gt;	{&lt;br&gt;		using( Process p = new Process() )&lt;br&gt;		{&lt;br&gt;			p.StartInfo.UseShellExecute = false;&lt;br&gt;			p.StartInfo.RedirectStandardOutput = true;&lt;br&gt;&lt;br&gt;			p.StartInfo.FileName = sCommandTool;&lt;br&gt;			p.StartInfo.Arguments = sCommandArguments;&lt;br&gt;&lt;br&gt;			p.Start();&lt;br&gt;&lt;br&gt;			sOutput = p.StandardOutput.ReadToEnd();&lt;br&gt;			p.WaitForExit();&lt;br&gt;		}	&lt;br&gt;&lt;br&gt;		litrOutput.Text = sOutput;&lt;br&gt;	}&lt;br&gt;	catch (Exception ex)&lt;br&gt;	{&lt;br&gt;		litrOutput.Text = &amp;quot;Error: &amp;quot; + ex.Message;&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;&lt;br&gt;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;html&amp;gt;&lt;br&gt;&amp;lt;body&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;form runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;asp:Button id=&amp;quot;btnRun&amp;quot; runat=&amp;quot;server&amp;quot; OnClick=&amp;quot;RunCommand&amp;quot; Text=&amp;quot;Run !&amp;quot;/&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;p&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;pre&amp;gt;&amp;lt;asp:Literal id=&amp;quot;litrOutput&amp;quot; runat=&amp;quot;server&amp;quot; EnableViewState=&amp;quot;False&amp;quot;/&amp;gt;&amp;lt;/pre&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;/body&amp;gt;&lt;br&gt;&amp;lt;/html&amp;gt;&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#597367</link><pubDate>Sun, 14 May 2006 14:58:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597367</guid><dc:creator>David.Wang</dc:creator><description>PL - I prefer ASP because it is simple, cleanly illustrates the issue, and allows me to explain what is going on without all the fluff. I am interested in explaining the underlying concepts and issues which stay valid through time, and not whatever is the latest and hotest technology.&lt;BR&gt;&lt;BR&gt;ASP.Net can only obscure the issue because it involve the Managed Code layer as a system... when we ultimately only care about the Win32 function calls generated by that system &lt;BR&gt;&lt;BR&gt;FYI: &lt;BR&gt;1. What you just wrote in ASP.Net is much shorter in ASP. &lt;BR&gt;2. Since the issue has nothing to do with ASP or ASP.Net but rather whether the code ultimately calls CreateProcess() or CreateProcessAsUser(), giving an ASP.Net-based solution does not seem fiiting. &lt;BR&gt;3. My explanation can be equally applied to PHP, Perl, etc - while an ASP.Net-based solution without explaining the fundamentals only caters to the ASP.Net user. &lt;BR&gt;&lt;BR&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#597493</link><pubDate>Sun, 14 May 2006 21:00:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597493</guid><dc:creator>PL</dc:creator><description>Oh my good, you just wrote two pages about it but you claim it was shorter ?&lt;br&gt;&lt;br&gt;I can make it shorter if you want me to:&lt;br&gt;&lt;br&gt;&amp;lt;%&lt;br&gt;System.Diagnostics.Process.Start(&amp;quot;whatever&amp;quot;);&lt;br&gt;%&amp;gt;&lt;br&gt;&lt;br&gt;I think you better buy a book about .NET, can't belive you work at MS.&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#597585</link><pubDate>Mon, 15 May 2006 02:28:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597585</guid><dc:creator>David.Wang</dc:creator><description>PL - yo, chill... we're both on the same side, just have different approaches, hear me out.&lt;br&gt;&lt;br&gt;I like to explain the details of what is going on so that anyone can apply knowledge to make their own decisions - critical thinking and problem solving - i.e. teach a man to fish, he will never go hungry&lt;br&gt;&lt;br&gt;You mention another popular approach - pattern matching - just give me a working solution to the problem. Fast and to the point.&lt;br&gt;&lt;br&gt;I am not saying that either is good/bad; everyone learns and teaches differently - so please be tolerent.&lt;br&gt;&lt;br&gt;RE: Book about .NET&lt;br&gt;&lt;br&gt;Me, I never need to buy a book about .NET; I already studied its core - MSIL / CLR - as well as the C# Specification. The .Net Framework is all applied stuff on top of the core. I don't need to buy a book - I just need to reflect on the DLL for its APIs and I am ready to go.&lt;br&gt;&lt;br&gt;With your approach, one has to buy a book about .NET and every new Namespace/API because that is how you obtain new information when you do not know how the core really works.&lt;br&gt;&lt;br&gt;Yes, my approach takes way more time (and pages) than yours, but that does not make either less valid. The objectives are different.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#597606</link><pubDate>Mon, 15 May 2006 03:14:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597606</guid><dc:creator>James Vierra</dc:creator><description>David, PL,&lt;br&gt;&lt;br&gt;Yes - youcan run a copy of an exe by altering the nature of IIS maknig it less secure and, yes, there might be a reason for doing this but I would question whether it is the best and safest approach.&lt;br&gt;&lt;br&gt;CGI runs EXEs (Console Apps) just fine but on most servers it is disabled by default for a reason. &amp;nbsp;If not set up carefully it can create a security issue.&lt;br&gt;&lt;br&gt;COM is a better approach and more controllable. &amp;nbsp;NET is even more configurable and potentially much more secure and powerful.&lt;br&gt;&lt;br&gt;If you are just delivering text then HTML is probably the best solution. &amp;nbsp;If you need to dio some simple server-side variable stuff then ASP is fine, easy and light weight.&lt;br&gt;&lt;br&gt;If you need access to data and other more complex operations in a highly interactive way then NET is currently, in my opinion , the best solution yet.&lt;br&gt;&lt;br&gt;Admins would like to run certain console applications under IIS for adminstrative convenience. &amp;nbsp;Usually they want to run non-NET executables, batch files and scripts. &amp;nbsp;This always runs into issues of output formatting and access authorization and authentication. More than any pervious technology NET 2.0 addresses many of these issues and provides good and secure methods for returning information to admins and users however there is a larger amount of setup overhead necessary to accomplish this.&lt;br&gt;&lt;br&gt;Davids answer was more than I would have attempted. &amp;nbsp;In my opinion if it doesn't run under IIS default setup then it shouldn't be run. &amp;nbsp;NEt can accomplish a ping interface that is more flexible than running ping.exe and doesn't require altering the default strong security.&lt;br&gt;&lt;br&gt;I love ASp book recommendations. &amp;nbsp;I read anything that may add to my understanding of almost anything but nothing compares to teh knowledge that you get by being there at the birthing of a fundamental technology. &amp;nbsp;Nothing compares to understanding the nuts and bolts that were used to build that technology. &amp;nbsp;My funfdamentals still sit on top of the bit toggling and flip-flop wiring that I did way back when...&lt;br&gt;&lt;br&gt;One question PL. &amp;nbsp;What kind of an application would one build using the code you posted?&lt;br&gt;&lt;br&gt;&amp;lt;% &lt;br&gt;System.Diagnostics.Process.Start(&amp;quot;whatever&amp;quot;); &lt;br&gt;%&amp;gt; &lt;br&gt;&lt;br&gt;What would the &amp;quot;whatever&amp;quot; do and why would you do it that way as apposed to some more IIS-like way.&lt;br&gt;&lt;br&gt;I am hoping you have an example that will make this useful knowledge because I spen some time running things this way and found that, for the process to be useful, I would need to hook it up to some form of input/output. &amp;nbsp;This is not hard to do if we modify the code to grab the process object but then it becomes more like normal aspx NET programming.&lt;br&gt;&lt;br&gt;Would you want to use this to start a service? &amp;nbsp;How about to run a job? &amp;nbsp;Well, in those cases, I would prefer other APIs designed for that so, then, what would we do with it.&lt;br&gt;&lt;br&gt;Davids discussion of &amp;quot;Console Apps from IIS&amp;quot; was very enlightening to me. &amp;nbsp;I had though I knew all of the ins and outs of this sort of thing but he put it all in a slightly new way which I found very helpful. &amp;nbsp;It will come in handy.&lt;br&gt;&lt;br&gt;However, you, PL, propose something that may also come in handy. I just don't see what it is at this point. &amp;nbsp;I, too, need to run things remotely and have felt that IIS could be a big help in doing this. &amp;nbsp;Anything that could make this easier would be appreciated.&lt;br&gt;&lt;br&gt;Now for my question. &amp;nbsp;David. &amp;nbsp;What are your thoughts on using &amp;quot;middle-tier&amp;quot; objects with elevated permisions to allow users to read data from rpotected objects? &amp;nbsp;There are security riskd in this I believe but some sort of guidance might help point the way to allowing admins a way to access protected resources through a web server without exposing the network to harm.&lt;br&gt;&lt;br&gt;I know in other posts you have addressed this issue to some degree. &amp;nbsp;It seems that the pieces may not have been drawn tightly together for this particular arena.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#598194</link><pubDate>Mon, 15 May 2006 21:25:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:598194</guid><dc:creator>Jason</dc:creator><description>I've been bashing my head against the monitor trying to get something like this to work consistently. &amp;nbsp;The issue I have is that i've pretty much turned my server into the definition of insecure by granting every know permission to every possible user/group. &amp;nbsp;A simple asp script to launch something like notepad&lt;br&gt;&amp;lt;%&lt;br&gt;set objShell = Server.CreateObject( &amp;quot;WScript.Shell&amp;quot; )&lt;br&gt;objShell.Run( &amp;quot;notepad.exe&amp;quot; )&lt;br&gt;%&amp;gt;&lt;br&gt;will work perfectly until I logoff the server (i have IIS set to interact with the desktop so i can see the results). &amp;nbsp;Once I log off, the asp page causes an application error on the server:&lt;br&gt;&amp;quot;The application failed to initialize properly (0xc0000142)..&amp;quot;&lt;br&gt;However, this error will magically go away after a few minutes/hours - that is, until I log off again. &lt;br&gt;&lt;br&gt;It seems like a permission error, but at this point an anonymous user from a kindergarten class could tell my server to format its hard drives. &amp;nbsp;Argh.</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#692952</link><pubDate>Wed, 09 Aug 2006 08:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:692952</guid><dc:creator>Nigol</dc:creator><description>I've been reading this blog over and over again and it helped me a lot - thanks.&lt;br&gt;However, I'm still having trouble executing some commands from a CGI script (in Perl) when I'm not a user of the administrators group.&lt;br&gt;&lt;br&gt;I created a web page where a CGI script executes the CVS command line tool. I also restricted this page to some users of our Windows domain by creating a local group (adding all required users to the group) and granting access only to this group.&lt;br&gt;&lt;br&gt;If the user is as well within the local administrators group everything works fine. If the user is not in this group the command (and lots of others) is ignored.&lt;br&gt;&lt;br&gt;Can you help?&lt;br&gt;&lt;br&gt;Thanks very much,&lt;br&gt;Nigol</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#692981</link><pubDate>Wed, 09 Aug 2006 09:20:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:692981</guid><dc:creator>David.Wang</dc:creator><description>Nigol - Did you read this link from this entry, which describes the behavior you observe? &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/david.wang/archive/2006/04/09/HOWTO_Run_Console_Applications_from_IIS6_on_Windows_Server_2003.aspx" target=_new rel=nofollow&gt;http://blogs.msdn.com/david.wang/archive/2006/04/09/HOWTO_Run_Console_Applications_from_IIS6_on_Windows_Server_2003.aspx&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;I believe what you are seeing is that Perl launches commands using CMD.EXE, which only allows Administrators from IIS to use it on Windows Server 2003. &lt;BR&gt;&lt;BR&gt;Thus, the issue is not that the command is "ignored" but that the command silently failed with access denied. &lt;BR&gt;&lt;BR&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#693839</link><pubDate>Thu, 10 Aug 2006 03:07:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:693839</guid><dc:creator>Nigol</dc:creator><description>Hi David,&lt;br&gt;&lt;br&gt;Thanks very much for your reply. I had read the article you mentioned, but what I had done wrong was to set the ACL on the commands I wanted to execute (e.g. cvs.exe) instead of CMD.EXE !!! &lt;br&gt;Having set the ACL on CMD.EXE everything is working now.&lt;br&gt;&lt;br&gt;Thanks once again,&lt;br&gt;Nigol</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#702198</link><pubDate>Wed, 16 Aug 2006 10:52:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:702198</guid><dc:creator>Altex</dc:creator><description>I have IIS6 and PHP as ISAPI. I configured PHP to run as ISAPI module and configured application pool for it, so when i execute &amp;quot;whoami&amp;quot; from PHP i see &amp;quot;nt authority\local service&amp;quot;. &lt;br&gt;&lt;br&gt;But the problem is that to run any external console executables from php script i have to set exec&amp;amp;read permitions to cmd.exe for NETWORK SERVICE user. But script runs with LOCAL SERVICE permition. And if i remove NETWORK SERVICE permitions and ad LOCAL SERVICE permitions - then script cat not run external program because of insufficient rights.&lt;br&gt;&lt;br&gt;Please, tell me how to configure IIS to run external programs from php (isapi) with local service user rights or what is wrong with cmd.exe permitions, why it needs network service permitions?&lt;br&gt;&lt;br&gt;Thanks for help!&lt;br&gt;&lt;br&gt;--&lt;br&gt;&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#712939</link><pubDate>Tue, 22 Aug 2006 20:53:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:712939</guid><dc:creator>deandany</dc:creator><description>Great article... it removed some blocks in my head regarding security... however i still have not been able to solve my problem after reading this article.... the following code in VB.net web application raises a hidden &amp;quot;Access Denied&amp;quot; error...&lt;br&gt;&lt;br&gt;Inside the batch file i am attempting foll. simple copy command &lt;br&gt;-----------------------------------&lt;br&gt;copy c:\test.log d:\test.log&lt;br&gt;EXIT&lt;br&gt;-----------------------------------&lt;br&gt;&lt;br&gt;In Code i do this on asp.net-button click event&lt;br&gt;&lt;br&gt;proc = New Process&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;workdir = String.Format(&amp;quot;E:\&amp;quot;)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.WorkingDirectory = workdir&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.UseShellExecute = False&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.FileName = filepath&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.RedirectStandardError = True&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.Arguments = &amp;quot;/c E:\test.bat&amp;quot;&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.StartInfo.CreateNoWindow = True&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc.Start()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sr = proc.StandardError&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;While (sr.Peek &amp;lt;&amp;gt; -1)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sr.ReadLine()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End While&lt;br&gt;&lt;br&gt;&amp;quot;sr.readline&amp;quot; consistently gives an access denied error inspite of &lt;br&gt;1) impersonation in web config&lt;br&gt;2)deny authorization=? in web config&lt;br&gt;3)anonymous access setting in Driectory Security in IIS5.0 &lt;br&gt;4)assign Full control to all the directories/files i used in code using Cacls.exe&lt;br&gt;Can anyone solve this? the sample above is a simple test.. if this works i have several things to be done using batch files&lt;br&gt;&lt;br&gt;Thanks in advance&lt;br&gt;&lt;br&gt;Behappy,&lt;br&gt;deandany&lt;br&gt;</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#716671</link><pubDate>Thu, 24 Aug 2006 11:18:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:716671</guid><dc:creator>David.Wang</dc:creator><description>deandany - Your issue is described in the link I mentioned in the blog entry.&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/david.wang/archive/2006/04/09/HOWTO_Run_Console_Applications_from_IIS6_on_Windows_Server_2003.aspx"&gt;http://blogs.msdn.com/david.wang/archive/2006/04/09/HOWTO_Run_Console_Applications_from_IIS6_on_Windows_Server_2003.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;By default, batch file execution using CMD.EXE does not work from IIS6, no matter what you configure.&lt;br&gt;&lt;br&gt;//David</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#739703</link><pubDate>Mon, 04 Sep 2006 18:36:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:739703</guid><dc:creator>Nino</dc:creator><description>Can we to this on linux aswell ?</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#3105517</link><pubDate>Wed, 06 Jun 2007 01:59:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3105517</guid><dc:creator>Willis</dc:creator><description>&lt;p&gt;Our administrators can not get php 5 to execute a shell command under win2003/iis6.&lt;/p&gt;
&lt;p&gt;I don't see why the administrator is not allowed to configure the system so that a specific executable can be called from php.&lt;/p&gt;
&lt;p&gt;It works on apache, but not 2003/iis6.&lt;/p&gt;
&lt;p&gt;Is IIS6 capable of this?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#6815577</link><pubDate>Thu, 20 Dec 2007 13:17:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6815577</guid><dc:creator>ori</dc:creator><description>&lt;p&gt;how can i use the CreateProcessWithLogonW() API function from vc6.0 without installing any .net /asp/c# packege on my IDE / computer/&lt;/p&gt;
&lt;p&gt; &amp;nbsp;(I understand it is essential to load a dll with this api, but this is the only thing I can use).&lt;/p&gt;
&lt;p&gt;i need CreateProcessWithLogonW() to do silent log on (with my known username and password) to a remote desktop. (I am a win2000 professional client rdp). I wish to open the remote desktop programatically without the user password popup/window/input fields.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;thenks&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; ori&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; kovacsio@hotmail.com&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#6823771</link><pubDate>Fri, 21 Dec 2007 06:37:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6823771</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;ori - I don't understand your question. VC6.0 can directly call CreateProcessWithLogonW() API. No .Net/ASP/C# required.&lt;/p&gt;
&lt;p&gt;For example, this is exactly what IIS6 does when it launches a w3wp.exe, and IIS6 has no .Net/ASP/C# code.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#6823794</link><pubDate>Fri, 21 Dec 2007 06:40:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6823794</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Willis - Administrators have an explicit Allow ACL on CMD.EXE to allow them to run shell commands. This is explicitly allowed by IIS6 and Windows Server 2003 security model.&lt;/p&gt;
&lt;p&gt;You must have a system that locked down CMD.EXE or PHP is not running as Administrator to run shell commands. Something is wrong with your server.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7822705</link><pubDate>Wed, 20 Feb 2008 22:46:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7822705</guid><dc:creator>ron</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I like all the discussions above, I used same way as following to load my application,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ProcessStartInfo startInfo = new ProcessStartInfo(@&amp;quot;C:\Program Files\Macromedia\FlashPaper 2\FlashPrinter.exe&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Process proc= new Process();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; proc.StartInfo = startInfo;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; startInfo.UserName = &amp;quot;Administrator&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; startInfo.Password = _password;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; startInfo.UseShellExecute = false; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; startInfo.Arguments = ...;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; proc.Start() ;&lt;/p&gt;
&lt;p&gt;My problem is, when I use &amp;quot;Administrator&amp;quot; the codes working OK, when I use other kind of users (except &amp;quot;Administrator&amp;quot;) or remove username and password, it is not working.&lt;/p&gt;
&lt;p&gt;&amp;quot;Administrator&amp;quot; account is not allow to use in my application, can any one please tell me how to create a user which has a lower right as &amp;quot;Administrator&amp;quot;, but still let the application works. &lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7823040</link><pubDate>Wed, 20 Feb 2008 23:11:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7823040</guid><dc:creator>ron</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;As my last post, my application is a traditional asp website, so &amp;nbsp;I can not use web config or add &amp;lt;identity impersonate=&amp;quot;true&amp;quot; userName=&amp;quot;accountname&amp;quot; password=&amp;quot;password&amp;quot; /&amp;gt;.&lt;/p&gt;
&lt;p&gt;I made properties to receive usernamse and password, the application is working OK only when user name is administrator, &amp;nbsp;but I am requested to use a non-admin account.&lt;/p&gt;
&lt;p&gt;Do you know how to fix it ?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7841847</link><pubDate>Thu, 21 Feb 2008 23:53:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7841847</guid><dc:creator>Darwin George</dc:creator><description>&lt;p&gt;I have a console application that aquires data from external equipment via ethernet packets and builds data files of the raw data then creates PCL/HPGL-2 print files from this data. &amp;nbsp;I want to launch an external program, a PCL to PDF converter .exe, from within my console application. &amp;nbsp;I am using cygwin to develop the app with and can't seem to locate the appropriate functions to allow me to launch the external .exe. &amp;nbsp;Any suggestions for me. &lt;/p&gt;
&lt;p&gt; &amp;nbsp;deg@vidcoinc.com&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7848145</link><pubDate>Fri, 22 Feb 2008 17:12:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7848145</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;ron - You need to clarify whether FlashPrinter.exe requires the user to have administrative privileges.&lt;/p&gt;
&lt;p&gt;Also, your code snippet is in .Net, but you say your application is traditional ASP website, so that seems to conflict. And if you want to run an application as another user, just use RUNAS.EXE and no need to use .Net.&lt;/p&gt;
&lt;p&gt;As for how to run code using a specific user identity - the answer is linked off this blog post, so I shall leave that exercise to the reader.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7848164</link><pubDate>Fri, 22 Feb 2008 17:14:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7848164</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;Darwin - There are many ways to launch external programs in Win32, but since you want cygwin, I won't be able to help.&lt;/p&gt;
&lt;p&gt;I suggest contacting cygwin support for your questions. This is a support forum for IIS/ISAPI related questions.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#7910605</link><pubDate>Wed, 27 Feb 2008 01:37:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7910605</guid><dc:creator>Joao</dc:creator><description>&lt;p&gt;Hello David,&lt;/p&gt;
&lt;p&gt;I have a problem that is exactly what you describe here. I want to execute cvs commands from a web application. I am using XP pro and IIS 5.1. What I do is call cvs using Process.Start() passing arguments in C#.&lt;/p&gt;
&lt;p&gt;The CVS behaves exactly like the &amp;quot;net&amp;quot; command. Apparently it returns nothing. I have success running other things like ipconfig but not with cvs or net. That is, I can get the returned output.&lt;/p&gt;
&lt;p&gt;My problem is that I'm not used to work with CGI/ISAPI and in IIS 5.1 I dont have the Web Services Extension so I am not quite sure How to get this to work. &lt;/p&gt;
&lt;p&gt;I've searched everywhere and even tried to make a script in vbs that simply calls cvs and returns the output. But that behaves the same way.&lt;/p&gt;
&lt;p&gt;Can you help me here? I'm starting to get despered! You seem to be by far the person who best understands this issue. &lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#8517564</link><pubDate>Sat, 17 May 2008 19:46:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8517564</guid><dc:creator>Jan</dc:creator><description>&lt;p&gt;Thanks David for te detailed information, was very helpful to get my CGI's working under IIS 60&lt;/p&gt;
&lt;p&gt;Thank you &lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#8587970</link><pubDate>Tue, 10 Jun 2008 03:24:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8587970</guid><dc:creator>BobMonahon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;First, thank you for this write up. &amp;nbsp;It's the first helpful document I've found. &amp;nbsp;However, I'm still having a problem: from an ASP page, running under IIS 6 on Win2K3, I'm trying to execute a batch file that launches a vb-script. &amp;nbsp;I get no error message, but nothing runs. &amp;nbsp;Here is a stripped-down version of my code. (Replacing brackets with parenthesis to avoid HTML hiding the bracketted code)&lt;/p&gt;
&lt;p&gt;ASP Page, located at (web root)\pye\pye_runload.asp&lt;/p&gt;
&lt;p&gt;(% &lt;/p&gt;
&lt;p&gt;Dim oShell: set oShell = Server.CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;Dim zBatchFile: zBatchFile = Server.MapPath(&amp;quot;..\bin\test_batch.bat&amp;quot;)&lt;/p&gt;
&lt;p&gt;Dim iReturn: iReturn = oShell.run(zBatchFile,1,false)	 &lt;/p&gt;
&lt;p&gt;Response.Write &amp;quot;Batch launched, rc=&amp;quot; &amp;amp; iReturn&lt;/p&gt;
&lt;p&gt;%)&lt;/p&gt;
&lt;p&gt;If the test_batch.bat runs, it creates an output file in the /bin/ folder. &amp;nbsp;I gave write permissions to the necessary accounts.&lt;/p&gt;
&lt;p&gt;The result on the ASP Page is: Batch launched, rc=0&lt;/p&gt;
&lt;p&gt;But nothing runs - there is no output file. &lt;/p&gt;
&lt;p&gt;If I run this: iReturn = oShell.run(zBatchFile,1,True)&lt;/p&gt;
&lt;p&gt;It get this: Batch launched, rc=1&lt;/p&gt;
&lt;p&gt;And again, there is no output file.&lt;/p&gt;
&lt;p&gt;On my Dev machine (IIS 5, WinXP) the batch and vbs script run fine.&lt;/p&gt;
&lt;p&gt;When I remote into the Win2K3 server and launch the batch from a cmd.exe window, it runs fine.&lt;/p&gt;
&lt;p&gt;I went through your checklist, plus some of my own:&lt;/p&gt;
&lt;p&gt;1. The web-site has &amp;quot;Parent Paths&amp;quot; enabled.&lt;/p&gt;
&lt;p&gt;2. The web-site uses a domain account for anonymous access&lt;/p&gt;
&lt;p&gt;3. The web-site has Read, Script, and Execute access turned on&lt;/p&gt;
&lt;p&gt;4. ASP.DLL is enabled as a Web Services Extension&lt;/p&gt;
&lt;p&gt;5. The web-site has a ScriptMaps property which associates .asp to ASP.DLL&lt;/p&gt;
&lt;p&gt;6. I make the request to &lt;a rel="nofollow" target="_new" href="http://localhost/"&gt;http://localhost/&lt;/a&gt;(website)/pye/pye_runload.asp&lt;/p&gt;
&lt;p&gt;Plus..:&lt;/p&gt;
&lt;p&gt;7. The Web-site Application Pool runs with a WAMUserName of the domain account&lt;/p&gt;
&lt;p&gt;8. All of these accounts have Read and Execute (and Write) access to the /bin/ folder:&lt;/p&gt;
&lt;p&gt; - the domain account&lt;/p&gt;
&lt;p&gt; - IUSR_machine_name&lt;/p&gt;
&lt;p&gt; - IWAM_machine_name&lt;/p&gt;
&lt;p&gt;Still, nothing. &amp;nbsp;To simplify, I copied cmd.exe into the /bin/ folder, and explicitly gave permissions to that copy of cmd.exe to the domain account and the IUSR_ and IWAM_ accounts. I put this in my ASP page:&lt;/p&gt;
&lt;p&gt;ASP Page, located at (web root)\pye\test_batch.asp&lt;/p&gt;
&lt;p&gt;(% &lt;/p&gt;
&lt;p&gt;Dim oShell: set oShell = Server.CreateObject(&amp;quot;WScript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;Dim zBatchCmd: zBatchCmd = &amp;quot;D:\BudgetTest\bin\cmd.exe /c dir *.* &amp;gt; D:\BudgetTest\bin\test_batch.txt&amp;quot;&lt;/p&gt;
&lt;p&gt;Dim iReturn: iReturn = oShell.run(zBatchCmd,1,True)	 &lt;/p&gt;
&lt;p&gt;Response.Write &amp;quot;Batch launched, rc=&amp;quot; &amp;amp; iReturn&lt;/p&gt;
&lt;p&gt;%)&lt;/p&gt;
&lt;p&gt;Result on the ASP Page is: Batch launched, rc=1&lt;/p&gt;
&lt;p&gt;.. and, nothing happens. No output file is created.&lt;/p&gt;
&lt;p&gt;Any help would be appreciated.&lt;/p&gt;
&lt;p&gt;Regards, Bob Monahon&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#8590706</link><pubDate>Wed, 11 Jun 2008 05:35:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590706</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;BobManahon - CMD.EXE on Windows Server 2003 will not run when launched via Win32 CreateProcess() (that's what oShell.Run boils down to) from IIS6, unless the Application Pool Identity is LocalSystem or if the Application Pool's ProcessIdentity == Impersonated Identity from Authentication.&lt;/p&gt;
&lt;p&gt;This pretty much prevents launching remote command consoles by hackers, as well as IIS scripts launching legitimate administration batch files.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#8927536</link><pubDate>Sat, 06 Sep 2008 10:37:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8927536</guid><dc:creator>Faiz</dc:creator><description>&lt;p&gt;Hey David, &lt;/p&gt;
&lt;p&gt;Thanks a ton for the article.&lt;/p&gt;
&lt;p&gt;One can also use processstartinfo class that is part of .net 2.0 to run process.&lt;/p&gt;
&lt;p&gt;However as long as i dont give explicit user name and password it works fine taking the app pool identity.&lt;/p&gt;
&lt;p&gt;But if i keep the app pool identity as network service and&lt;/p&gt;
&lt;p&gt;give user id and password(secure string) to the processstartinfo&lt;/p&gt;
&lt;p&gt;class it gives an exception &amp;quot;Application failed to initialize properly&amp;quot;.&lt;/p&gt;
&lt;p&gt;Any help on this will be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Faiz&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#9238165</link><pubDate>Fri, 19 Dec 2008 01:03:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9238165</guid><dc:creator>monty</dc:creator><description>&lt;p&gt;I am trying to run a batch file which in turn calls a vbs file from iis6 but its failing with permission error 800a0046 permission denied. &lt;/p&gt;
&lt;p&gt;I have given permission to iusr_computer to run the file within iis all the extensions are allowed as this is behind a firewall and on the intranet and only used to display results of tests, in an attempt to automate the tests so they automatically restart is what I am trying to do. &lt;/p&gt;
&lt;p&gt;my page &lt;/p&gt;
&lt;p&gt;sendvuserend.asp only contains the following&lt;/p&gt;
&lt;p&gt;&amp;lt;%@language=vbscript%&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;%&lt;/p&gt;
&lt;p&gt;set wschell=Server.CreateObject(&amp;quot;Wscript.shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;wshell.run &amp;quot;c:\restart.bat&amp;quot;&lt;/p&gt;
&lt;p&gt;%&amp;gt;&lt;/p&gt;
&lt;p&gt;I don't understand why this doesn't work&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#9249523</link><pubDate>Tue, 23 Dec 2008 11:06:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249523</guid><dc:creator>David.Wang</dc:creator><description>&lt;p&gt;monty - for security reasons, that is no longer allowed by Windows Server 2003 -- unless you match the Application Pool Identity to the Impersonated Identity, or if the Application Pool Identity is Local System (ultra-insecure).&lt;/p&gt;
&lt;p&gt;It does not matter what permissions you grant, nor what you enable within IIS, etc.&lt;/p&gt;
&lt;p&gt;//David&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#9536574</link><pubDate>Tue, 07 Apr 2009 23:09:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9536574</guid><dc:creator>alan c.</dc:creator><description>&lt;p&gt;hi david,&lt;/p&gt;
&lt;p&gt;I'm building my first web app, and I've run into the scenario as described by joao. I've been scouring the web to see what information I can find, and through that I've come across your post. I'm building and testing my application on win xp pro that has IIS 5.1 ( hopefully that won't disqualify me from a response :) &lt;/p&gt;
&lt;p&gt;Let me describe my issue, and my understanding from the context of your post...&lt;/p&gt;
&lt;p&gt;In my application I call a batch file using an instance of System.Diagnostics.Process. The batch file calls the net.exe to map a drive on the webserver:&lt;/p&gt;
&lt;p&gt;start net.exe use X: &amp;lt;some path to a network resource&amp;gt;&lt;/p&gt;
&lt;p&gt;This is tied to a button click on my web application, and when its invoked, nothing happens. When I try variants of the batch file, like calling a vb script to generate a message box to make sure that the batch is called, I get errors with wscript or net.exe indicating that the application failed to initialize properly.&lt;/p&gt;
&lt;p&gt;So from what you said this is what I understand:&lt;/p&gt;
&lt;p&gt;1. Since net.exe doesn't conform to the CGI specification, I shouldn't attempt to run it directly, and I shouldn't waste time looking at that.&lt;/p&gt;
&lt;p&gt;2. Since I'm using a batch file to invoke net.exe, IIS regards this as ASP. To get this to work, the extension needs to be scriptmapped to cmd.exe. (Done via application configuration of web app in IIS)&lt;/p&gt;
&lt;p&gt;3. cmd.exe is strict with security, the bat file executes under CreateProcessAsUser(), and will probably require the appropriate credentials, and if I have impersonation setup properly that should be sufficient.&lt;/p&gt;
&lt;p&gt;Could you confirm the above conclusions I made? Is that enough to get my bat file to work properly? I'm stuck right now, because I am blocked from creating new application extension mappings, so I can't move forward with my testing.&lt;/p&gt;
&lt;p&gt;Also, by adding the mapping, are there some security issues I need to be concerned with?&lt;/p&gt;
&lt;p&gt;The post by Maurits was a little to terse for me, (the opposite of this post) but do we even need to worry about the newline/carriage return if we're running net.exe scriptmapped?&lt;/p&gt;
</description></item><item><title>re: HOWTO: Run Console Applications from IIS6 on Windows Server 2003, Part 2</title><link>http://blogs.msdn.com/david.wang/archive/2006/04/28/HOWTO-Run-Console-Applications-from-IIS6-on-Windows-Server-2003-Part-2.aspx#9923940</link><pubDate>Tue, 17 Nov 2009 23:24:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9923940</guid><dc:creator>jf</dc:creator><description>&lt;p&gt;Great Article.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;I can make this work for everything but shutdown -s -t 25 from xp pro 64 bit running php 64 bit with fastcgi under iis 64 bit.&lt;/p&gt;
&lt;p&gt;Any pointers?&lt;/p&gt;
</description></item></channel></rss>