Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: DNSCMD will not work in Perl script

by dasgar (Priest)
on Feb 28, 2014 at 17:05 UTC ( #1076571=note: print w/replies, xml ) Need Help??

in reply to DNSCMD will not work in Perl script

How it works is, I have a web form that I fill out and when I click Submit, it runs the .pl script and calls the .pm file which contains the dnscmd lines.
...when I take one of the lines of my script and run it from an elevated command line, it works and adds the entries

I could be wrong, but I believe the statements of yours listed above point to a permissions issue.

With the first statement, it sounds like you're running this as a script via a web server. Most web servers are running server side scripts with a restricted user account. Probably the web server's user account for responding to web requests does not have permissions to run the dnscmd.exe utility.

Even if you were to make that web server user account a member of the administrator user group (which I don't recommend you doing), your second statement points to another issue. Even with administrator level rights, you're having to use a command prompt with elevated permissions (i.e. a command prompt opened with "Run as Administrator"). Off hand, I'm not sure of how to accomplish this. This sounds a lot like the issue in someone else's recent post (Cannot execute external process).

Don't necessarily have answers for you, but thought this might help point you in the right direction.

  • Comment on Re: DNSCMD will not work in Perl script

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1076571]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-12-17 22:51 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (466 votes). Check out past polls.