Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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
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 taking refuge in the Monastery: (9)
As of 2016-10-27 21:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (371 votes). Check out past polls.