C# Class DNSManagement.ServiceManager

Datei anzeigen Open project: drorgl/MSDNSWebAdmin Class Usage Examples

Public Methods

Method Description
Create ( string name, string displayName, string pathName, Service serviceType, Service errorControl, Service startMode, bool desktopInteract, string startName, string startPassword, string loadOrderGroup, string loadOrderGroupDependencies, string serviceDependencies ) : MethodExecutionResultEnum

create a new system service

List ( ) : IList

Retrieves a list of all services

ServiceManager ( ) : System

Service - local

ServiceManager ( string host, string username, string password ) : System

Service - host/username/password

Method Details

Create() public method

create a new system service
public Create ( string name, string displayName, string pathName, Service serviceType, Service errorControl, Service startMode, bool desktopInteract, string startName, string startPassword, string loadOrderGroup, string loadOrderGroupDependencies, string serviceDependencies ) : MethodExecutionResultEnum
name string Name of the service to install to the Create method. The maximum string length is 256 characters. The Service Control Manager database preserves the case of the characters, but service name comparisons are always case-insensitive. Forward-slashes (/) and double back-slashes (\) are invalid service name characters.
displayName string Display name of the service. This string has a maximum length of 256 characters. The name is case-preserved in the Service Control Manager. DisplayName comparisons are always case-insensitive.
pathName string Fully qualified path to the executable file that implements the service.
serviceType Service Type of services provided to processes that call them.
errorControl Service Severity of the error if the Create method fails to start. The value indicates the action taken by the startup program if failure occurs. All errors are logged by the system.
startMode Service Start mode of the Windows base service.
desktopInteract bool If true, the service can create or communicate with windows on the desktop.
startName string Account name under which the service runs. Depending on the service type, the account name may be in the form of DomainName\Username. The service process is logged using one of these two forms when it runs. If the account belongs to the built-in domain, .\Username can be specified. If NULL is specified, the service is logged on as the LocalSystem account. For a kernel or system-level drivers, StartName contains the driver object name (that is, \FileSystem\Rdr or \Driver\Xns) which the input and output (I/O) system uses to load the device driver. If NULL is specified, the driver runs with a default object name created by the I/O system based on the service name. Example: DWDOM\Admin.
startPassword string Password to the account name specified by the StartName parameter. Specify NULL if you are not changing the password. Specify an empty string if the service has no password.
loadOrderGroup string Group name associated with the new service. Load order groups are contained in the registry, and determine the sequence in which services are loaded into the operating system. If the pointer is NULL or if it points to an empty string, the service does not belong to a group. Dependencies between groups should be listed in the LoadOrderGroupDependencies parameter. Services in the load-ordering group list are started first, followed by services in groups not in the load-ordering group list, followed by services that do not belong to a group. The registry has a list of load ordering groups located at: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ServiceGroupOrder
loadOrderGroupDependencies string Array of load-ordering groups that must start before this service. Each item in the array is delimited by NULL and the list is terminated by two NULL values. In Visual Basic or script you can pass a vbArray. If the pointer is NULL or if it points to an empty string, the service has no dependencies. Group names must be prefixed by the SC_GROUP_IDENTIFIER (defined in the Winsvc.h file) character to differentiate it from a service name, because services and service groups share the same namespace. Dependency on a group means that this service can run if at least one member of the group is running after an attempt to start all of the members of the group.
serviceDependencies string Array that contains names of services that must start before this service starts. Each item in the array is delimited by NULL and the list is terminated by two NULL values. In Visual Basic or script you can pass a vbArray. If the pointer is NULL, or if it points to an empty string, the service has no dependencies. Dependency on a service means that this service can only run if the service it depends on is running.
return MethodExecutionResultEnum

List() public method

Retrieves a list of all services
public List ( ) : IList
return IList

ServiceManager() public method

Service - local
public ServiceManager ( ) : System
return System

ServiceManager() public method

Service - host/username/password
public ServiceManager ( string host, string username, string password ) : System
host string
username string
password string
return System