Jump to content

PHP mkdir unc path IIS7


mafiatfc

Recommended Posts

I have a domain controller in which I have much code written to create a domain user via a PHP webpage.  I have a seperate webserver running IIS7 with PHP 5.2.  I need to create a folder in a unc path on our file server.

 

The example code I'm trying to get to work is:

 

<?php
mkdir("\\\\x.x.x.x\\users\\testuser");
?>

 

The problem: "Warning: mkdir(): Permission denied"

 

My goal is: after a user is created in Active Directory (which I have working), I need to create that user's home directory on our file server.

 

I've tried setting permissions on the file server share for Everyone as full. 

Link to comment
Share on other sites

Yes, on the file server I have permissons set for "Everyone" and that permission has full rights to the share.

 

If I access the share through windows I can create/delete files and folders, however the PHP script mkdir gets a permission denied.  I wonder if there is some kind of user settings for IIS?

Link to comment
Share on other sites

Isn't this user local to the server running IIS, in which I would not be able to use this username on a different server's share?

 

I'm not a windows person but I do have to put up with it at work and these accounts are within active directory for us as well. Usually something like... IUSR_MACHINENAME/DOMAIN. Can't be any assistance with how they get there but these accounts are available throughout our entire network. Placed there by our network administers I should imagine.

Link to comment
Share on other sites

I figured it out.  I created a service account in active directory.  On the remote web server IIS, I used anonymous authentication using an application pool with the domain service account as the user.  On the remote shares I have the domain service account with rights to the shared folder.  Now I am able to use mkdir and shell features like icacls to assign user rights to folders inside the share.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.