Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Looking for a wmi script to run a vbs script remotely

Posted on 2011-03-21
1
Medium Priority
?
363 Views
Last Modified: 2012-05-11
Looking for a wmi script to run a vbs script remotely. For example we create a vbs script that creates a word document then edit it and saves it. If possible would like to see run on remote machine. Purpose of this script is to monitor virtual desktop environments.
0
Comment
Question by:williamfl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
Tuyau2poil earned 2000 total points
ID: 35184577

You can try this (may need impersonation) :

set objWMIService = getobject("winmgmts://" & strComputer & "/root/cimv2")

' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")

Set objProgram = objProcess.Methods_("Create").InParameters.SpawnInstance_

objProgram.CommandLine = "cscript.exe myapp.vbs"

'Execute the program
Set strShell = objWMIService.ExecMethod( "Win32_Process", "Create", objProgram)


you can also use psexec utility. have a look to this page : http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_22932472.html



0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question