/build/static/layout/Breadcrumb_cap_w.png

Running a script on target machines

Hello:

I am sorry but I am a newbie to scripting. I have created a vb script to do an uninstall of an application. I want to target computers and run the script against them and record the output to a file. I know I can put this in a logon script and let it run that way but I really need to target the machines and run it that way.

Does anyone know of a way to run a script agains another computer remotely?

Thanks.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: Ilikebananas 19 years ago
Purple Belt
0
You could check out PSEXEC from the pstools suite from sysinternals (http://www.sysinternals.com/).

Maybe that will allow you to do what you want...
Posted by: Garrett 19 years ago
Orange Belt
0
Stolen from: [link]http://cwashington.netreach.net/depo/view.asp?Index=326&ScriptType=vbscript[/link]



NameSpace = "root\cimv2"
Server = "ComputerName or IP"
UserName = "domain\user"
Password = "thePassword"

command = "calc"

Set Locator = CreateObject("WbemScripting.SWbemLocator")

If Err.Number Then
msgbox = Err.description
Err.Clear
End If

Set Service = Locator.ConnectServer (Server, NameSpace, UserName, Password)
Service.Security_.impersonationlevel = 3

If Err.Number Then
msgbox = Err.Description & " " & """" & Server & """"
err.clear
End If

Set Instance = Service.Get("Win32_Process")

If Err.Number then
msgbox = Err.Description
Err.Clear
End If

intStatus = Instance.Create(Command, null, null, intProcessId)

If intStatus = 0 Then

If intProcessId < 0 Then
'4294967296 is 0x100000000.
intProcessId = intProcessId + 4294967296
End If

themsg = "Succeeded in executing " & Command & "." & vbCRLF
msgbox themsg & vbcrlf & "The process id is " & intProcessId & "."
Else
msgbox "Failed to execute " & Command & ". " & Err.Description

End If
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ