in reply to Re^3: windows auth
in thread windows auth

No, it has nothing to do with the script.

You eliminated the second possible reason I gave, leaving the first.

The user as which web server executes CGI scripts doesn't have permission to access the network. You need to give that user that permission or run the script as a user that does have that permission.