Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by flyingmoose (Priest)
on Apr 29, 2004 at 15:01 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://349153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-25 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found