PHP xcacls.vbs

Posted on 2007-10-03
Last Modified: 2013-12-13
I am running (PHP + IIS) a command line job (job.bat) which has xcacls command running.

When I run job.bat manually by typing in the cmd line of the server it works fine. But when I run it from the webpage (php) it runs but showing an error that i can't find the doman\account as follows.

Can't find Account: "DOMAIN_22\KMercs" Could not find /G user/group: "DOMAIN_22\KMercs" removing from list. Can't find Account: "DOMAIN_22\KMercs" Could not find /D user/group: "DOMAIN_22\KMercs" removing from list. Error: No Groups or Names entered were found, exiting script. Operation Complete Elapsed Time: 1.050781 seconds. Ending Script at 10/3/2007 5:08:24 PM

xcacls in the job.bat looks as follows

c:\batch\xcacls c:\folderxyz /E /G  Domain_22\Admin:F /server HCIFPVS01 /user Domain_22\Admin /Pass XPasswrX

Thanks for your response.
Question by:ITHCI
    LVL 28

    Accepted Solution

    The PHP script probably runs under a limited account, like IUSR_xxxx (which is machine local if the IIS is not a domain controller). Therefore it can't query the active directory for accounts.
    It may help if you connect to the domain in your script like:

    net use \\<domain controller>\ipc$ /user:<domain>\<username> password
    c:\batch\xcacls c:\folderxyz /E /G  Domain_22\Admin:F /server HCIFPVS01 /user Domain_22\Admin /Pass XPasswrX
    net use \\<domain controller>\ipc$  /del /y

    hope it helps


    Author Comment

    My apologies for not replying to this for so long.

    The anonomus access was disabled and integrated windows auth was enabled in the IIS.

    The user i am loging in to webpage is a domain account have access to query active directory.

    LVL 28

    Assisted Solution

    Hm, for debugging add a line before your xcacls statement

    set  > C:\TEMP\env.log

    Then do what calls the script . Afterwards have a look at the env.log. Check if USERNAME is correct.

    Author Comment

    Yes. The username is correct.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now