PC Review Forums Newsgroups Windows XP Windows XP WMI Remote command

Reply

Remote command

 
Thread Tools Rate Thread
Old 25-06-2004, 08:12 PM   #1
Brion Keagle
Guest
 
Posts: n/a
Default Remote command


First, I admit I know very little about WMI. I can barely spell it. ;-)

But I understand I may be able to run a remote command using WMIC?

All I want to do is to run netstat against a remote computer. Can I do
this? Can someone please provide me an example of how?

Thanks in advance,
-Brion


  Reply With Quote
Old 25-06-2004, 09:48 PM   #2
Sean Gahan
Guest
 
Posts: n/a
Default Re: Remote command

Brion,
Check out this app; it's open source and will allow you to perform console
apps on a remote machine, like netstat, ping or what ever.
http://www.codeguru.com/Cpp/I-N/net...ticle.php/c5433

Regards,

Sean

"Brion Keagle" <bkeagle@concord.com> wrote in message
news:OyjXrCvWEHA.3488@TK2MSFTNGP09.phx.gbl...
> First, I admit I know very little about WMI. I can barely spell it. ;-)
>
> But I understand I may be able to run a remote command using WMIC?
>
> All I want to do is to run netstat against a remote computer. Can I do
> this? Can someone please provide me an example of how?
>
> Thanks in advance,
> -Brion
>
>



  Reply With Quote
Old 27-06-2004, 10:04 PM   #3
Torgeir Bakken \(MVP\)
Guest
 
Posts: n/a
Default Re: Remote command

Brion Keagle wrote:

> First, I admit I know very little about WMI. I can barely spell it. ;-)
>
> But I understand I may be able to run a remote command using WMIC?
>
> All I want to do is to run netstat against a remote computer. Can I do
> this? Can someone please provide me an example of how?

Hi

A couple of non-WMI solutions (in addition to the one
mentioned by Sean):


PsExec.exe in the free PsTools suite, found at
http://www.sysinternals.com

PsExec can even automatically copy a file over to the remote computer
before it starts it.


Another freeware program with similar merits to PsExec is Beyondexec.
http://www.beyondlogic.org/consulti.../BeyondExec.htm

Beyondexec also have multiple computer functionality.



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/co...er/default.mspx
  Reply With Quote
Old 28-06-2004, 04:50 PM   #4
Brion Keagle
Guest
 
Posts: n/a
Default Re: Remote command

Thanks guys, for the links, but I'd rather do this using native Microsoft
controls. You see I want to script or compile this app once it's built. I
see all these suggestions throughout the WMI Help files which suggest that I
should be able to run tools like netstat against a remote machine. Yet I
can't find any specific help on how exactly to do it. If anyone has any
hints, I'd sure appreciate it.

Thanks!
-Brion

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:O3MppKJXEHA.2844@TK2MSFTNGP11.phx.gbl...
> Brion Keagle wrote:
>
> > First, I admit I know very little about WMI. I can barely spell it.

;-)
> >
> > But I understand I may be able to run a remote command using WMIC?
> >
> > All I want to do is to run netstat against a remote computer. Can I do
> > this? Can someone please provide me an example of how?

> Hi
>
> A couple of non-WMI solutions (in addition to the one
> mentioned by Sean):
>
>
> PsExec.exe in the free PsTools suite, found at
> http://www.sysinternals.com
>
> PsExec can even automatically copy a file over to the remote computer
> before it starts it.
>
>
> Another freeware program with similar merits to PsExec is Beyondexec.
> http://www.beyondlogic.org/consulti.../BeyondExec.htm
>
> Beyondexec also have multiple computer functionality.
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/co...er/default.mspx



  Reply With Quote
Old 29-06-2004, 10:20 PM   #5
Rick Krause [MSFT]
Guest
 
Posts: n/a
Default Re: Remote command

You can use the Win32_Process to run an app, but on a remote machine it won't have a UI. That may not be an issue if the app is a console app and you can redirect the
output to a file.

Another limitation with Win32_Process comes into play if the target computer is part of an Active Directory. You won't be able to access the network from that computer
unless your network admins have enabled delegation for that machine.

One way to deal with those limitations is to use the Win32_ScheduledJob class to start the process instead of Win32_Process. You'll have to ensure that the AT Service
Account on the target system is logged on with an account that has network access if you need it.

Finally, if the tool you want to use allows you to specify the target computer, you can run the process on your local machine using any of the various scripting or win32
methods available. (For example, WSH's WshShell.Exec() or WshShell.Run() methods.)

--------------------
Thanks guys, for the links, but I'd rather do this using native Microsoft
controls. You see I want to script or compile this app once it's built. I
see all these suggestions throughout the WMI Help files which suggest that I
should be able to run tools like netstat against a remote machine. Yet I
can't find any specific help on how exactly to do it. If anyone has any
hints, I'd sure appreciate it.

Thanks!
-Brion
--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off