netservice v1.0 (command-line tool)

Services in MS-Windows™ impact the functioning of a system. With a default installation of MS-Windows™, many unnecessary services are installed and are automatically enabled at startup. It is a tedious job for administrators to stop or uninstall unnecessary services on each individual computer.


netservice allows you to manage installed services on local and remote machines without physically logging in to the machine. This tool helps system administrators in performing housekeeping tasks and security auditors in checking the services running on remote systems when direct access is not always possible.




netservice's uses include these actions on local and remote computers -


  • Enumerate all the services

  • Enumerate dependencies of the service

  • Check the configuration of service

  • Check the status of service

  • Start/Stop/Pause/Delete the service

  • Save results in XML formats



  • Installation

    Just copy netservice onto your executable path. Typing "netservice -h" displays its usage syntax.




    Usage

    The syntax is straightforward and easy to learn.




    Usage : netservice [options..]

    -c < computer >Remote computer name or IP address. This is a mandatory parameter.

    -u < user > Username for logging on remote computer.

    -p < password > Password for logging on remote computer. Prompts for password, if not supplied.

    -query < service >Queries the service configuration

    -servtype < type >Selects the type of the service. By default, this value is set to 0.

    This must be used along with the enumeration option.
    Possible values are:
    0 – show information for all installed services
    1 – show information for type SERVICE_WIN32
    2 – show information for type SERVICE_DRIVER


    -servstat < stat >Selects the state of the service. By default, this value is set to 0.

    This must be used along with the enumeration option.
    Possible values are:
    0 – show information for all installed services
    1 – show information for state SERVICE_ACTIVE
    2 – show information for state SERVICE_INACTIVE


    -enumsrv Enumerate services information

    -enumdep < service >Show dependencies for the supplied service name

    -status < service > Shows the status of the supplied service name

    -config < service > Shows the configuration of the supplied service name

    -name < service > Shows the service display name for the supplied service name


    -start < service > -args < argument >Starts the service


    -stop < service >Stops the service

    -pause < service >Pauses the service

    -resume < service >Resumes the service

    -delete < service >Deletes the service

    -ox < output file >Dumps output to netservice.xml, if output file is not specified

    -? / -hDisplays the help screen

    Arguments supplied to netservice are case sensitive.







    Examples

    To check and dump output to netservice.xml, the configuration of w3svc service on a machine with IP address 10.10.8.7, using administrator credentials,


    netservice -c 10.10.8.7 -u administrator -query w3svc -ox


    To enumerate all inactive WIN32 services and dump output to service.xml,


    netservice -enumsrv -servtype 1 -servstat 2 -ox service.xml


    To enumerate all the services and dump output to allservices.xml,


    netservice -enumsrv -ox allservices.xml


    To enumerate dependencies for the active service iisadmin, type


    netservice -enumdep iisadmin -servstat 1


    To enumerate all dependencies for the service iisadmin, type


    netservice -enumdep iisadmin


    Operating Systems supported:

    netservice has been tested on Windows 2000, Windows XP and Windows 2003.


    netservice is included in a command-line toolkit named NSTools from Net-Square, that aid in the administration and audit of remote Windows NT/2K/XP/2003 systems.