Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
"be consistent"
 
PerlMonks  

Re: Running Win32 binary as arbitrary user -- in Perl

by flyingmoose (Priest)
on Apr 29, 2004 at 15:01 UTC ( #349153=note: print w/ replies, xml ) Need Help??


in reply to Running Win32 binary as arbitrary user -- in Perl

There is a catch-22 here, of course. You need to have 'act as part of the operating system' rights for the current user to be able to call LogonUser ... hence, you need to be an Administrator (or a system service) to impersonate the Administrator :)

All I want to do is start/stop a service while not running as Administrator, so I guess I will need to use RunAs after all -- anybody know the Windows equivalent of Expect.pm ???


Comment on Re: Running Win32 binary as arbitrary user -- in Perl
Re: Re: Running Win32 binary as arbitrary user -- in Perl
by Mungbeans (Pilgrim) on Apr 29, 2004 at 15:12 UTC
    Would Win32::Service help? There's a suite of service management functions including: StopService.

    You might be able to get that to play nicely with Win32::AdminMisc CreateProcessAsUser.

    If you have much Win32 stuff to play with Dave Roth's book "Win32 Perl Programming: The Standard Extensions, Second Edition" is well worth checking out.

      Yes, it will help the code (thanks!) -- just won't get me around the evil act-as-part-of-OS-permission problem!

      BTW, I didn't know David Lee Roth was into Perl. Awesome!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://349153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-04-18 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (464 votes), past polls