http://qs321.pair.com?node_id=57432

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to access a NT network share from a CGI script running on an NT web server? So far I have only been able to access the local file system of the web server.

Replies are listed 'Best First'.
Re: Access network resources from CGI script on NT web server
by tye (Sage) on Feb 09, 2001 at 22:48 UTC
    The default WinNT CGI security environment has no access to network resources at all.

    Even if you change your CGI environment to run as a specific user, the CGI scripts will be run as that user except with no access to network resources.

    I think you can get past this by using LoginAsUser() and RunProcessAsUser() (probably from Win32::AdminMisc from http://www.roth.net/) but that involves storing the password "in the clear" somewhere where the CGI script can get at it and I consider that just one small step from publishing the password on the internet (ie., a security risk).

Re: Access network resources from CGI script on NT web server
by Mitch (Sexton) on Apr 21, 2003 at 20:27 UTC
    This can be accomplished by going into IIS and select the directory/program being executed. In Properties select "Directory Security", then click the "edit" button for Authentication control. Under "Allow Anynmous Access" click "Edit" and then de-select the default account and add an account that has full permissions to the network devices you want to hit. Ex: Enter a domain admin account.
Re: Access network resources from CGI script on NT web server
by Anonymous Monk on Mar 29, 2001 at 03:15 UTC
    If Anonymous Authentication in use then disable "Automatic Password Synchronization" if IIS is running on Domain Controller. Miroslav