mikehjun

Running Vbs script for Sleeping map services

Discussion created by mikehjun on Aug 24, 2010
Latest reply on Jul 19, 2013 by santiago.horcajo
Hi Folks,

I ran Joshua's vbs script to cure sleeping map services issues. It ran great in outside dmz server but not in inside. These two machines are identical, window 2008. 64 bit, sp2. the most current window updates are installed.

It gave me an error message like 'The object invoked has disconnected from its clients', code: 80010108, source: null

Any idea?



+++++++++++++++++++++++++
Joshua Campbell's script

'declare web app variable, set variable to be an IE application
Dim webApp
Set webApp= CreateObject("InternetExplorer.Application")

'set visibility of the web app, can be set to false to run in the background
webApp.Visible = true

'declare a counter variable as integer, set it to zero
Dim counter
counter = 0

'declare array to hold names of different services
'simply increase the array by +1 and add a new entry for every new service that gets published

dim services(6)
services(0)="serviceName/MapServer"
services(1)="serviceName/MapServer"
services(2)="serviceName/MapServer"
services(3)="serviceName/MapServer"
services(4)="serviceName/MapServer"
services(5)="serviceName/MapServer"
services(6)="serviceName/MapServer"

'the following loop uses the REST API and the array to step through each service page
'wait 5 seconds, then navigate to the next service. The loop runs 5 times.

Do while counter < 5
    For Each x in services     
      webApp.Navigate "http://serverName/ArcGIS/rest/services/"& x
      wscript.sleep(5000)
    Next' 
  counter = counter + 1
Loop

webApp.quit
Set webApp = nothing

Attachments

Outcomes