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.
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
[ - ] Hide Comments

so that the conversation will remain readable.
Answer this question
or Comment on this question for clarity
Answers
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...
Maybe that will allow you to do what you want...
Please log in to comment
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
Please log in to comment
Comments