Tech

Guides
 

Service management in Windows Server 2003 and 2008

By Rick Vanover, Special to ZDNet Asia
Tuesday, May 20, 2008 12:35 PM

Use the service controller command found in Windows Server 2003 and 2008 to set a service to disabled, automatic or manual.

The sc (service controller) command manages Windows services from the command line. This can be integral to any semi-automated failover mechanism, service watchdog or a mass update that requires some configuration to the service.

For Windows Server 2003 and Windows Server 2008 environments, the sc command takes the familiar "net start" to additional levels by allowing a service to be set to disabled, automatic or manual, as well as control functions to the service in the current state.

You might use the sc command if you need to update something on your environment, and you need to stop a monitoring service that every server uses. In this situation, you could stop each monitoring agent on each server and make the service disabled with the following code:

sc SERVER1 stop "AlertManagerService"
sc SERVER1 config " AlertManagerService " start= disabled

If you use the sc command in reverse, it can enable and restart the service. With the sc command, you can have one central script execute service configuration tasks on multiple servers remotely when the appropriate permissions are available.

When using the sc command, the service name may not match the name you see in the Windows services MMC snap-in. If you use a BlackBerry Enterprise Server (BES), you may have the BlackBerry MDS service installed on your BES server. This service is an example where the display name does not match that of the service name. With the sc command, you can run the following command:

sc email-bes001 GetDisplayName MdsTomcat

The command will give the display name from the services MMC snap-in; from there, you can relate it to your functional needs. Figure A is the output of running this command.

Figure A

Figure A

You should not omit the base application of sc for creating Windows services. With its remote connection and implementation capabilities, sc can be a critical tool for pushing out a new version of a service with a series of one-liners in scripts when simple file updates, description changes, or configuration of a service are required to reduce the effort in touching similar systems.

The sc command parameters are consistent across Windows Server 2003, Windows Server 2008, and Windows XP, making mixed platform deployments simplified, with only the ShowSid string available on Windows Server 2008.

While the sc command was delivered in the Windows NT era, it is still valuable in mass deployments today for service management.



WORTHWHILE?

1

1 votes
Blog

Talkback 0 comments

There are currently no comments for this post.

Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers / Case Studies

Downloads

Windows Server News


Tech Jobs Now!

Tags

  1. .net
  2. access
  3. active
  4. analysis
  5. availability
  6. data
  7. directory
  8. do
  9. documents
  10. double-take
  11. excel
  12. high
  13. management
  14. microsoft
  15. page
  16. ports
  17. project
  18. secure
  19. server
  20. service
  21. services
  22. should
  23. simply
  24. sql
  25. time
  26. tips
  27. use
  28. using
  29. windows
  30. word