mafiatfc Posted January 6, 2010 Share Posted January 6, 2010 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 More sharing options...
corbin Posted January 7, 2010 Share Posted January 7, 2010 Considering that the syntax is correct and that PHP supports that, I suspect that permission actually is denied. Have you checked the permissions? Link to comment https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-990618 Share on other sites More sharing options...
mafiatfc Posted January 9, 2010 Author Share Posted January 9, 2010 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 https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-991527 Share on other sites More sharing options...
trq Posted January 9, 2010 Share Posted January 9, 2010 Quote I wonder if there is some kind of user settings for IIS? There is the IUSR_* account that IIS runs under. Link to comment https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-991529 Share on other sites More sharing options...
mafiatfc Posted January 9, 2010 Author Share Posted January 9, 2010 Quote Quote I wonder if there is some kind of user settings for IIS? There is the IUSR_* account that IIS runs under. 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? Link to comment https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-991586 Share on other sites More sharing options...
trq Posted January 9, 2010 Share Posted January 9, 2010 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. Link to comment https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-992011 Share on other sites More sharing options...
mafiatfc Posted January 16, 2010 Author Share Posted January 16, 2010 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 https://forums.phpfreaks.com/topic/187369-php-mkdir-unc-path-iis7/#findComment-995903 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.