Running Vbs script for Sleeping map services

3117
3
08-24-2010 11:00 AM
MikeJun
New Contributor II
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
0 Kudos
3 Replies
RaviNarayanan
Esri Contributor
If you are using ArcGIS Server 10.0, check out this new service option to check/repair invalid connection to data.

See section "Checks for invalid data connections" in this help:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000069...
0 Kudos
AnthonyScilingo
New Contributor
I'm running into this same problem, this script works fine on my Windows 2003 box but on my 2008 R2 box it blows up with the error: The object invoked has disconnected from its clients.  Any ideas?
0 Kudos
SantiagoHorcajo
New Contributor II
You only have to "run it as Administrator". For example, run a cmd as administrator and execute it directly and I think it shouldl work well, at least for me it does. If you want to run it as a automated task in Windows 2008, you have to mark in the general tab the checkbox with a text similar to "run it with elevated privileges" (I don't know what's exactly the label of the checkbox in the english version of the operating system).
Hope it helps.
0 Kudos