Jump to content

Recommended Posts

I have made a webpage for creating Active Directory users.  The page makes the user in AD then uses icacls on a share to give that new user rights to the home directory.  When the user and their home directory is deleted from active directory and recreated with the same name it obviously has a new SID.  When the page goes through its code it appears that icacls uses the SID that was previously used therefore the user cant save to their home directory because they have the wrong permissions.

 

Now, if I disable the icacls portion of the PHPpage and just have it create a user and then type in the icacls command manually in cmd.exe it finds the correct SID.

 

This is the line from the page:

$output = shell_exec("icacls \\\\dc\\share\\" . $username . " /grant " . $adDomainShort . "\\" . $username . ":(OI)(CI)(M)") or die("cacles died");

 

Is there a way to make the page get the current SID instead of the old one from the previously deleted user?

 

 

Link to comment
https://forums.phpfreaks.com/topic/204450-icacls-reusing-old-sid/
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.