Restart ArcGIS Server Object Manager Remotely

I wanted to post this because I think it’s cool and showcases the very tip of Windows Powershell. Plus, I got tired of keeping an RD session open the the GIS Server for when I wanted to restart AGS.

If you haven’t discovered Windows Powershell, you should. It is the command line Windows needs. I know very little about it, meaning:

  • You can use .NET to write ‘cmdlets’, which are scripts.
  • You can browse more than just files. For example, you can cd into the registry. I thought this was surreal.
  • You can easily access other boxes.
  • Tons more

Anyway, go download powershell (from the above link) if you don’t have it and open up a PS prompt. This assumes that you are on your dev box and AGS is on a remote server. Type:

Get-WmiObject -computer agsServerName Win32_Service -Filter "Name='ArcServerObjectManager'" | Restart-Service

Replace ‘agsServerName’ with your AGS Server name.  BOOM. Service restarts.  Oh, and it’ll work for any service on the box, just change the service name in the Filter expression.

I have been lightly using Powershell for a long time, but really need to do more with it.


About Ruprict

I am a nerd that is a Nerd Wannabe. I have more kids than should be allowed by law, a lovely wife, and a different sense of humor than most. I work in the field of GIS, where I am still trying to find myself on the map. View all posts by Ruprict

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: