Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 ???

  • 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?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2023-02-06 20:37 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (36 votes). Check out past polls.