in reply to Getting a Local/Remote Win32 Task List

Having not used Win32::PerfLib before, I am curious about this snippet of code, but I don't quite understand what I need to pass in for $server. Are you looking for the IP? Or a machine name? or something else? Thanks.

-Adam

  • Comment on RE: Getting a Local/Remote Win32 Task List

Replies are listed 'Best First'.
RE: RE: Getting a Local/Remote Win32 Task List
by gaggio (Friar) on Jul 06, 2000 at 23:09 UTC
    You can pass either (machine name or IP). Try it, it is working here (I litteraly did a "cut-and-paste" from within my NT remote controlling project - yes, I actually wrote one).
      gaggio, i tried using your little tidbit and it is awesome. you rock! Being a beginner in perl, i was wondering if you know how to format the info displayed from the remote tlist? Thanks in advance. Ray
        use strict; use Win32::PerfLib; my $h='hostname'; my %tasks=get_remote_process_list($h); foreach my $key(keys %tasks){ print "$key\t$tasks{$key}\n"; }
        /cab
        Well, you can simply use the printf function!
        It is just like in C++.
        Go to PerlDoc.com or simply type "printf" in the search box at the top of the page!
        Printf should be used only if you really need to. Most of the formatting can be done with the print() function.
Re: RE: Getting a Local/Remote Win32 Task List
by Anonymous Monk on Jul 30, 2002 at 01:25 UTC
    I'm getting: Can't call method "GetObjectList" on an undefined value at RasUpload.pl line 68. when using your sub and I have no idea why....any ideas? doofie_dee@yahoo.com
      i'm getting the same error. find anything out?
        You have to 'use' Win32::PerfLib.. put use Win32::PerfLib; at the top of your script : )
        I had this error when trying to connect using a Windows account that didn't have rights on the remote server. However, running the script with a userid that can access the remote server gives you the full list.