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
https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/
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?

  Quote

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.