netport 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.

net service 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 netps onto your executable path. Typing "netservice -h" displays its usage syntax.


Usage

The syntax is straightforward and easy to learn.

< computer >
Remote computer name or IP address. This is a mandatory parameter.
-u < user >
Username for logging on a remote computer.
-p < password >
Password for logging on a remote computer. Prompts for the 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 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
-enumsrv
Enumerate services information
-enumdep < service >
Shows the status of the supplied service name
-status < service >
Download a file from the remote computer's working directory
-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
-? / -h
Displays the help screen

Arguments supplied to netservice are case sensitive.

Download netport ( 222 KB)

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.