It isn't that hard to install a service remotely. You just copy the files to the Admin$ share and remotely add a small subtree to the registry. When the computer reboots, the service is installed and runs. What to put in the Registry can be determined by installing the service on your machine and copying.

You can even not be so hackish and use the Win32 API for installing services and probably get the service running without the remote computer being rebooted (though I haven't actually done that so I can't promise, it just appears that such would be so).

You can also run remote commands according to Using WMI for create a remote Process on Win32.

BTW, I'm one of those pissy users ;) and would likely disable your daemon when I found it. Having a Perl script run as a daemon isn't a trivial matter. Perl chooses "use more memory" at nearly every design trade-off and having my work interfered with because you think you need an inventory of my machine and silently installed a memory-hogging daemon isn't going to make me happy.

I'd rather you get an inventory by running the script at midnight w/o installing stuff on my computer. You need to figure out what computers are on your network anyway (if you don't know this already then you must be using DHCP so you could look to your DHCP servers for the answer), so track that and when was the last time you got an inventory on that computer. Each midnight, try to get an inventory on computers that are due one. If any computers go two weeks after that without ever being running at midnight, then run the inventory on them at noon.

Or you can go the other route and buy SMS from Microsoft and treat all of your users like trespassers on their desktop. ;)

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Laziness and the Win32::Daemon by tye
in thread Laziness and the Win32::Daemon by Macphisto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.