In order to start and stop a server, you must first retrieve the Server object using the PluginInterface. For example, expanding on the code in the previous section:
ServerInfoObject = Servers.Item(1);
// Get the actual Server object.
Server = ServerInfoObject.PluginInterface("");
To retrieve the Server object using the PluginInterface, you must have the Server plugin installed and registered. Once you have the Server object, you can use the ManageServer method to start and stop the server. For example, to start the server:
Server.ManageServer(ceServerStart);
Unlike the manipulation of many other objects, when you start, restart, or stop a server, you do not need to use InfoStore.Commit to commit the changes to the APS. That is, the server is immediately started, stopped, or restarted.
Note: If you stop a server, depending on which server you stop, you will not be able to run script or start the server again using script. For example, if you stop the WCS, and are using CSP, you will not be able to run any CSPs to start the server again. Similarly, if you stop the APS, you will not be able to query the APS or restart any servers. To start or enable a server, you must have at least one WCS and one APS in the cluster already running. If you do not have these, you will need to use the Crystal Configuration Manager to start the server. See the "Changing server status using the CCM" in the Administration Guide for details.
Note: To run on Unix, or when authenticating a remote server in Windows, ManageServer requires values for the parameters TimeoutSeconds, UserName, and Password. For Windows, the UserName parameter should contain the format Domain\UserName.
Next: Enabling and disabling a server.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |