Avatar of jvincent9
jvincent9

asked on 

Create Folder on Remote Server using ASP/IIS 6

I have a classic ASP application that I am working on for my helpdesk staff to use to create users in AD.  Everything works great except for the piece that creates the users home folder on a remote file server.  I can get it to work using Firefox, but it will not work in IE 6 or 7.  I have a virtual folder under my root website that is using anon. authentication with a domain user that has rights to create folders where I keep my user's home folders.  Looking through security logs on my file server, it looks like IE is not using the anon account when connecting to my file server, but firefox does.  I really need this to work in IE.

Just using the scripting.filesystemobject.  strHomeFolder is a variable that is set earlier in the script. Gets set to \\server\users_share\username

Again, this works in firefox, so I believe the code is correct.
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
 objFS.CreateFolder(strHomeFolder)

Open in new window

Microsoft IIS Web ServerASP

Avatar of undefined
Last Comment
jvincent9
Avatar of bui_trung_hieu
bui_trung_hieu
Flag of Viet Nam image

The ASP Code runs on server-side while IE or FF is client's browser. So there cannot be any relation between them in this problem.

Please try checking whether the folder you want to create exists or not.

Set objFS = Server.CreateObject("Scripting.FileSystemObject")
 
if objFS.FolderExists(strHomeFolder)=true then
  response.write("Folder " & strHomeFolder & " exists!")
else
  objFS.CreateFolder(strHomeFolder)
end if

Open in new window

Avatar of jvincent9
jvincent9

ASKER

Thanks bui_trung_hieu

That didn't work.  The folder to be created definitely do not exist. I have a custom 501 error page setup that emails me when I get 500 server error pages.  It tells me "Permission Denied"  It almost acts like IE doesn't push the credentials setup in the anonymous settings (it is a domain user with full access to the folder in question), but firefox does.  When using firefox, I can see the logon in the security event log where the user I have setup logs on, but when I run the asp page in IE, all I see is anonymous logon, not the user I have specified.
Avatar of effx
effx
Flag of United Kingdom of Great Britain and Northern Ireland image

Ok the issue is that your logged on as a domain user, in IE this will send the details of the currently logged on user which is available under Request.ServerVariables("LOGON_USER") if you allow a single user to update instead of the anon user this will fix the problem.
Avatar of jvincent9
jvincent9

ASKER

Have tried that too...  I am logged onto my windows workstation with my domain account, which has domain admin priveledges, and full access to the file server in question.

I'm leaning more towards an IIS 6 issue rather than a coding issue at this point, seeing the page will work properly in firefox.
ASKER CERTIFIED SOLUTION
Avatar of effx
effx
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of jvincent9
jvincent9

ASKER

I resolved the issue by changing the directory security in IIS to basic only.  This prompts for the AD account to login with, and seems to pass that login informaiton off to the file server where I need to create my folders.  I know it is not the most secure way, but I have HTTPS enabled on the site, with one of our internal certificates.
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo