I developed this small windows form application which uses arcgis server dll's and restart the server object. I hardcoded the server name , server object name in the code. Actually I dont have time to create modify this code so that it accepts command line arguments. You can actually use this code and create a windows utility to restart a server object. Please let me know if it worked for you or not.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.ADF.ArcGISServer;
using ESRI.ArcGIS.ADF.Connection;
using ESRI.ArcGIS.Server;
namespace som_admin
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// Using the ArcGIS Connection library
ESRI.ArcGIS.ADF.Identity id = new ESRI.ArcGIS.ADF.Identity("username","password","Domain name");
ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsconn;
agsconn = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection("server name", id);
agsconn.Connect();
IServerObjectAdmin soa = agsconn.ServerObjectAdmin;
soa.StopConfiguration("world", "Mapserver");
soa.StartConfiguration("world", "MapServer");
}
}
}
Hope this helps.
Thanks
Aditya