Running DOS Commands with Unix UNC Paths within ASP

Running DOS Commands with Unix UNC Paths within ASP

am 03.04.2008 08:04:00 von Support

I just posted this in microsoft.public.inetserver.iis but thought this might
be a better place for it.
I have the following ASP page that simply executes a DIR command on a UNC
path and displays the results. When the UNC path is a Windows machine the
output is as expected however when the UNC path is a Unix machine running
Samba, nothing is returned. I've configured the Authentication Method for the
IIS web site to use an account that has permissions to both the Windows and
Unix shares and confirmed this is the case by logging into the IIS server via
RDP as this account and running the command from a DOS window, which works
fine for both the Windows and Unix shares. The Samba server is configured to
authenticate against the same domain as the IIS and File share servers.

I don't believe there is a permissions problem and instead there is some
wierd interaction between the CMD.EXE instance created by the ASP page and
Unix server running Samba.

<%
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("cmd /c dir \\server\share")
Set objStdOut = objExec.StdOut
strOutput = objStdOut.ReadAll
Response.Write strOutput
%>