Most of us are familiar with the famous NET command since the Windows NT days. The NET command to handle network services is part of the NTLM and LAN Manager coming from the days of MS-DOS.
Now we have Windows 2003 and the NET command doesn’t quite make it, as it does not show the service properties completely.
Enter the SC command.
From the Microsoft website:
“Communicates with the Service Controller and installed services. SC.exe retrieves and sets control information about services. You can use SC.exe for testing and debugging service programs. Service properties stored in the registry can be set to control how service applications are started at boot time and run as background processes. “
From my Windows XP computer, when I type SC in a command window:
DESCRIPTION: SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc [command] [service name] …
The option has the form “\\ServerName”
Further help on commands can be obtained by typing: “sc [command]”
Commands:
query———–Queries the status for a service, or
enumerates the status for types of services.
queryex———Queries the extended status for a service, or
enumerates the status for types of services.
start———–Starts a service.
pause———–Sends a PAUSE control request to a service.
interrogate—–Sends an INTERROGATE control request to a service.
continue——–Sends a CONTINUE control request to a service.
stop————Sends a STOP request to a service.
config———-Changes the configuration of a service (persistant
description—–Changes the description of a service.
failure———Changes the actions taken by a service upon failur
qc————–Queries the configuration information for a servic
qdescription—-Queries the description for a service.
qfailure——–Queries the actions taken by a service upon failur
delete———-Deletes a service (from the registry).
create———-Creates a service. (adds it to the registry).
control———Sends a control to a service.
sdshow———-Displays a service’s security descriptor.
sdset———–Sets a service’s security descriptor.
GetDisplayName–Gets the DisplayName for a service.
GetKeyName——Gets the ServiceKeyName for a service.
EnumDepend——Enumerates Service Dependencies.
The following commands don’t require a service name:
sc boot————(ok | bad) Indicates whether the last boot should be saved as the last-known-good boot configuration Lock————Locks the Service Database QueryLock——-Queries the LockStatus for the SCManager Database EXAMPLE: sc start MyService
Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]:
This looks really interesting as I have a server migrated using Server Migration Pack – Physical to ProLiant Edition. The services don’t start properly, especially RPC Server, Network Connections, Workstation and Server.
In addition, I can’t view the detail entries in the Event Viewer and the properties of the services in Services MMC.
SC has a query module to list the properties of the services. Perhaps the above mentioned critical services got their Logon Account messed up and I can use SC to fix this.
More details later