Contributed by Anonymous Monk on Feb 09, 2001 at 22:17 UTC
Q&A  > CGI programming


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.

Answer: Access network resources from CGI script on NT web server
contributed by tye

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 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).

Answer: Access network resources from CGI script on NT web server
contributed by Mitch

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.

Answer: Access network resources from CGI script on NT web server
contributed by Anonymous Monk

If Anonymous Authentication in use then disable "Automatic Password Synchronization" if IIS is running on Domain Controller. Miroslav

Please (register and) log in if you wish to add an answer

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.