Re: Is It possible to run a script as admin?
From: news.microsoft.com (Richard_at_RaptorCon.net)
Date: 04/14/04
- Next message: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Previous message: Joe Earnest: "Re: right click context menu in windows explorer"
- In reply to: cseeger: "Re: Is It possible to run a script as admin?"
- Next in thread: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Reply: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Reply: cseeger: "Re: Is It possible to run a script as admin?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Apr 2004 13:03:27 -0400
If the device is Win2K or WinXP, you can use RunAs, however Runas will only
work with an exe and you'll also have to specify a password (unencrypted).
The best way to do this is to use a program (Wise Installer is what I use)
to compile your code in an exe.
You'll still have the problem of passing the password, the way I have done
this in the past is to;
Create an exe with your compiled code.
Create another exe that calls RunAs+.exe (a microsoft scriptable runas
available on the net).
Then you call runas+ to run the 1st exe in admin context passing it
the necessary parameters (& password).
SMS Installer could be used but be aware that it can be decompiled by
another SMSInstaller user and read the password.
I would also suggest:
* Putting the password in split up string variables for more security
* Try to place all the code necessay and date encode it so that if someone
was to get ahold of the exe (1st one complied in the 2nd one) then there
would not be any danger of them passing other arguments to run other code in
admin context.
If you were using WMI to connect to a remote box, then you could connect as
alterante credentials, however this is not possible when called from the PC
itself.
Richard
"cseeger" <cseeger@nospam.nospam> wrote in message
news:Xns94CB76449FCAEcseegerinteractivede@207.46.248.16...
> cseeger <cseeger@nospam.nospam> wrote in
> news:Xns94CB756302C5Bcseegerinteractivede@207.46.248.16:
>
> > Is it possible for me to run a script with administrator rights? From a
> > regular domain user account???
> >
> > thanks!!
> >
> > -cseeger
> >
>
> Sorry, I should elaborate. I wrote a script that requires the user have
> admin access. I dont want to grant that. Infact, the script is a logon
> script. If I could just allow admin access for the logon script I'd be
> set.
>
> So, is there a way to elevate the account status to admin, just to run
> the script. Then switch the account status back to normal user????
>
> thanks!
>
> -cseeger
- Next message: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Previous message: Joe Earnest: "Re: right click context menu in windows explorer"
- In reply to: cseeger: "Re: Is It possible to run a script as admin?"
- Next in thread: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Reply: Joe Earnest: "Re: Is It possible to run a script as admin?"
- Reply: cseeger: "Re: Is It possible to run a script as admin?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|