RE: Connecting to remote servers with scripting object

From: Jrex7 (Jrex7_at_discussions.microsoft.com)
Date: 01/25/05


Date: Tue, 25 Jan 2005 07:23:03 -0800

Here's some info:

I recommend you download and learn WSH from here
http://www.microsoft.com/downloads/details.aspx?FamilyID=c717d943-7e4b-4622-86eb-95a22b832caa&DisplayLang=en

Prerequisite to running remote scripts.

Remote WSH, which is a new technology included in WSH 5.6, provides the
ability to run a script on a remote machine or machines. With Remote WSH, the
script is physically copied from the local machine to the remote machine
before executing. In order to enable Remote WSH functionality, you must first
set up the remote machine with the proper security settings. The steps below
perform the tasks that enable Remote WSH.

Note Both the remote and local machines must be running Windows NT 4 SP3
or greater in order to use Remote WSH.
To enable a machine to run remote scripts

Install WSH V5.6 on the machine. If you are using Windows 2001 or have
installed Internet Explorer 6 or greater, WSH 5.6 has already been installed.
Note WSH 5.6 is available for download from the web at
http://msdn.microsoft.com/scripting
Add yourself to the remote machine's Local Administrators group.
To enable Remote WSH, use Poledit.exe on the server.
Note An administrator who wants to enable Remote WSH must either acquire
the Windows 2000 resource kit, or use http://msdn.microsoft.com/scripting to
acquire the necessary windowsscript.adm file that contains the WSH settings.
The windowsscript.adm file must be copied to the server that sets the
gapplicabel group's policies. Although it is not necessary to copy the file
to the server's \WINNT\INF directory, this is nonetheless where the default
adm files are located.
Note For more information on Poledit.exe, see the Poledit.exe's online
help system.
WSH should now be enabled on the machine. To test it, see Running Scripts
************************************************
WSH 5.6 can run scripts that reside on remote systems. The following scripts
demonstrate this capability. These scripts make the assumption that the files
are located on a local machine directory called "c:\wsh5.6"; change the local
path and the remote machine name as necessary.

After initially running RemoteTest.WSF on the local machine, there may be a
small pause as DCOM verifies your identity. After you see the "Done" message,
a file named "c:\beenhere.txt" on the remote machine indicates the time that
you executed the command (from the remote computer's clock).

' VBScript.
RemoteTest.WSF
-------------------------------
<package>
<job>
<script language="VBScript">
set oController = CreateObject("WSHController")
set oProcess = oController.CreateScript("c:\wsh5.6\beenhere.wsf",
"remmachine")
oProcess.Execute
While oProcess.Status <> 2
   WScript.Sleep 100
WEnd
WScript.Echo "Done"
</script>
</job>
</package>
-------------------------------

BeenHere.WSF
-------------------------------
<package>
<job>
<script language="VBScript">
set fso = CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile("c:\beenhere.txt", true)
fout.WriteLine Now
fout.Close
</script>
</job>
</package>

"Paul Knight" wrote:

> Does anyone know if it is possible (and if so how) to connect to a remote
> Virtual Server via the scripting interface. I use some scripts to manage
> several Virtual Servers but all the scripts seem to need to run locally to
> each server. I'd like to put together a web page to pull together the status
> of several servers and their VMs but I can't find a way to connect from one
> server to another.
>



Relevant Pages

  • FlexWATCH-Webs 2.2 (NTSC) Authorization Bypass
    ... Exploitation: Remote with browser ... as their security surveillance server, it is ridiculous that a company ... XSS appears and the server allows an attacker to inject & execute scripts. ...
    (Bugtraq)
  • RE: Connecting to remote servers with scripting object
    ... > Prerequisite to running remote scripts. ... > Remote WSH, which is a new technology included in WSH 5.6, provides the ... use Poledit.exe on the server. ...
    (microsoft.public.windows.server.scripting)
  • Possible Impersonation Issue?
    ... Server 2003 except one of the remote sites. ... WMI scripts that I have used for months started failing on all DCs. ...
    (microsoft.public.windows.server.general)
  • Re: Authenticating to W2k3 Server outside of my domain
    ... I found code in WSH to spawn an instance of a program but I ... > I've also found code in WMI to authenticate into a server... ... PsExec can even automatically copy a file over to the remote computer ...
    (microsoft.public.win32.programmer.wmi)
  • CreateScript error "ActiveX component cant create object."
    ... WSH 5.6 can run scripts that reside on remote systems. ... After initially running RemoteTest.WSF on the local machine, ...
    (microsoft.public.scripting.wsh)