Tuesday, June 02, 2015

wmic: Getting process (and arguments!) in a remote server

wmic can be very convenient to obtain information about the processes running on a remote server.

I downloaded a VM from dev.modern.ie/tools/vms for testing. (It's valid only for 30 days and doesn't permit to be licensed!) and have been testing it.

A curious question came in - how to find remote processes in a windows PC using wmic? How will you get the complete arguments?

C:\>wmic /node:ie8winxp /user:IE8WINXP\Administrator /password:Passw0rd! /output:stdout process list /format:htable " > c:\temp.html
"

Note that the redirection above will be to local desktop's c:\temp.html, not remote c:\temp.html

If you wish to redirect to an internal file in the remote PC, you can simply save the command in the remote host and call it.

Sample: 

Save the below as a file, say c:\temp\1.bat

wmic process list /format:htable > c:\temp.html

Call it using :

C:\>wmic /node:ie8winxp /user:IE8WINXP\Administrator /password:Passw0rd! process call create "C:\temp\1.bat"

Examples at : http://ss64.com/nt/wmic.html

And more at: http://blogs.technet.com/b/jhoward/archive/2005/02/23/378726.aspx

0 Comments:

Post a Comment

<< Home