admin

i have perl script and i am logged in as administrator

how do i make my per script is running as an administrator and not IUSR_machinename account
perlperlAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Adam314Commented:
Is this when you run the script from the command prompt, or when a webserver runs the script?
0
perlperlAuthor Commented:
command prompt
0
Adam314Commented:
The script should run as administrator (or whatever logon name is used) when you run from a command prompt - unless the script attempts to change users on it's own.


Have you looked at the USERNAME environment variable from within the script?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

ahoffmannCommented:
runas /user:administrator your-script.pl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
perlperlAuthor Commented:
is this a dos command

/user:administrator perl script.p,
0
ahoffmannCommented:
yes/no, just C&P to cmd.exe
0
perlperlAuthor Commented:
i get this


C:\>runas /user:administrator perl xl.pl
RUNAS USAGE:

RUNAS [/profile] [/env] [/netonly] /user:<UserName> program

   /profile        if the user's profile needs to be loaded
   /env            to use current environment instead of user's.
   /netonly        use if the credentials specified are for remote access only.
   /user           <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   program         command line for EXE.  See below for examples

Examples:
> runas /profile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE:  Enter user's password only when prompted.
NOTE:  USER@DOMAIN is not compatible with /netonly.
0
ahoffmannCommented:
you have to use you domain also, instead of
  /user:administrator
use
    /user:Your-Domain-here\administrator
then you also have to quote the command with its options:
  "perl xl.pl"
0
perlperlAuthor Commented:
how to find domain name
0
perlperlAuthor Commented:
i tried that, i get
"attempting to start perl test.pl and nothing happened
0
perlperlAuthor Commented:
first it prompted for password...after entering correct password...nothing happened...it just exited without any error saying
attempting to start perl test.pl
0
perlperlAuthor Commented:
but when i do
echo %errorlevel%, i get
1

which there was something wrong
0
perlperlAuthor Commented:
the complete message was
attempting to start perl test.pl as user domain\Administrator....
0
ahoffmannCommented:
does your script run as normal user?
0
perlperlAuthor Commented:
how do i find that......
wat i know is i have loggen in to this host as Administrator
0
ahoffmannCommented:
> how do i find that......
perl test.pl
0
perlperlAuthor Commented:
when i login to the host,
i enter username "Administrator" and some password....but when i m trying to do some operations, i get access denied...
Am i the administrator or not?
0
perlperlAuthor Commented:
when i go to to
my computer -> manage -> local users and group  -> users
if i right click Administrator -> properties

i get,

"could not prepare property pages because: access is denied"

why do I get this message even i am logged is as administrator, or someone else is the administror with diffeent username
0
ahoffmannCommented:
so we do not have a perl nor a programming problem, but a permission problem with your system?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.