- WMI Library -
WMI Libraly > Win32_TerminalService Class

Win32_TerminalService Class

The Win32_TerminalService class provides Terminal Service load balancing indicators.
Namespace value is root/CIMV2.
WMI Provider value is Win32_WIN32_TERMINALSERVICE_Prov.


Properties

  • AcceptPause
  • The AcceptPause property indicates whether the service can be paused.
    Values: TRUE or FALSE. A value of TRUE indicates the service can be paused.

  • AcceptStop
  • The AcceptStop property indicates whether the service can be stopped.
    Values: TRUE or FALSE. A value of TRUE indicates the service can be stopped.

  • Caption
  • The Caption property is a short textual description (one-line string) of the object.

  • CheckPoint
  • The CheckPoint property specifies a value that the service increments periodically to report its progress during a lengthy start, stop, pause, or continue operation. For example, the service should increment this value as it completes each step of its initialization when it is starting up. The user interface program that invoked the operation on the service uses this value to track the progress of the service during a lengthy operation. This value is not valid and should be zero when the service does not have a start, stop, pause, or continue operation pending.

  • CreationClassName
  • CreationClassName indicates the name of the class or the subclass used in the creation of an instance. When used with the other key properties of this class, this property allows all instances of this class and its subclasses to be uniquely identified.

  • Description
  • The Description property provides a textual description of the object.

  • DesktopInteract
  • The DesktopInteract property indicates whether the service can create or communicate with windows on the desktop.
    Values: TRUE or FALSE. A value of TRUE indicates the service can create or communicate with windows on the desktop.

  • DisconnectedSessions
  • The number of disconnected sessions on this server. These sessions may still be actively consuming server resources, however they currently have no network.

  • DisplayName
  • The DisplayName property indicates the 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.
    Constraints: Accepts the same value as the Name property.
    Example: Atdisk.

  • ErrorControl
  • If this service fails to start during startup, the ErrorControl property specifies the severity of the error. The value indicates the action taken by the startup program if failure occurs. All errors are logged by the computer system. The computer system does not notify the user of "Ignore" errors. With "Normal" errors the user is notified. With "Severe" errors, the system is restarted with the last-known-good configuration. Finally, on"Critical" errors the system attempts to restart with a good configuration.

  • ExitCode
  • The ExitCode property specifies a Win32 error code defining any problems encountered in starting or stopping the service. This property is set to ERROR_SERVICE_SPECIFIC_ERROR (1066) when the error is unique to the service represented by this class, and information about the error is available in the ServiceSpecificExitCode member. The service sets this value to NO_ERROR when running, and again upon normal termination.

  • InstallDate
  • The InstallDate property is datetime value indicating when the object was installed. A lack of a value does not indicate that the object is not installed.

  • Name
  • The Name property uniquely identifies the service and provides an indication of the functionality that is managed. This functionality is described in more detail in the object's Description property.

  • PathName
  • The PathName property contains the fully qualified path to the service binary file that implements the service.
    Example: \SystemRoot\System32\drivers\afd.sys

  • ProcessId
  • The ProcessId property specifies the process identifier of the service.
    Example: 324

  • ServiceSpecificExitCode
  • The ServiceSpecificExitCode property specifies a service-specific error code for errors that occur while the service is either starting or stopping. The exit codes are defined by the service represented by this class. This value is only set when the ExitCodeproperty value is ERROR_SERVICE_SPECIFIC_ERROR, 1066.

  • ServiceType
  • The ServiceType property supplies the type of service provided to calling processes.

  • Started
  • Started is a boolean indicating whether the service has been started (TRUE), or stopped (FALSE).

  • StartMode
  • The StartMode property indicates the start mode of the Win32 base service. "Boot" specifies a device driver started by the operating system loader. This value is valid only for driver services. "System" specifies a device driver started by the IoInitSystem function. This value is valid only for driver services. "Automatic" specifies a service to be started automatically by the service control manager during system startup. "Manual" specifies a service to be started by the service control manager when a process calls the StartService function. "Disabled" specifies a service that can no longer be started.

  • StartName
  • The StartName property indicates the 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 will be 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 will be logged on as the LocalSystem account. For 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. Additionally, 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.

  • State
  • The State property indicates the current state of the base service.

  • Status
  • The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are "OK", "Degraded" and "Pred Fail". "Pred Fail" indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are "Error", "Starting", "Stopping" and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither "OK" nor in one of the other states.

  • SystemCreationClassName
  • The scoping System's CreationClassName.

  • SystemName
  • The name of the system that hosts this service

  • TagId
  • The TagId property specifies a unique tag value for this service in the group. A value of 0 indicates that the service has not been assigned a tag. A tag can be used for ordering service startup within a load order group by specifying a tag order vector in the registry located at: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GroupOrderList. Tags are only evaluated for Kernel Driver and File System Driver start type services that have "Boot" or "System" start modes.

  • TotalSessions
  • The total number of sessions on this server. This includes both connected and disconnected sessions.

  • WaitHint
  • The WaitHint property specifies the estimated time required (in milliseconds) for a pending start, stop, pause, or continue operation. After the specified amount of time has elapsed, the service makes its next call to the SetServiceStatus function with either an incremented CheckPoint value or a change in Current State. If the amount of time specified by WaitHint passes, and CheckPoint has not been incremented, or the Current State has not changed, the service control manager or service control program assumes that an error has occurred.


    Methods

  • StartService
  • The StartService method attempts to place the service into its startup state. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • StopService
  • The StopService method places the service in the stopped state. It returns an integer value of 0 if the service was successfully stopped, 1 if the request is not supported, and any other number to indicate an error. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • PauseService
  • The PauseService method attempts to place the service in the paused state. It returns an integer value of 0 if the PauseService request was accepted, 1 if the request is not supported, and any other number to indicate an error. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • ResumeService
  • The ResumeService method attempts to place the service in the resumed state. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • InterrogateService
  • The InterrogateService method requests that the service update its state to the service manager. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • UserControlService
  • The UserControlService method attempts to send a user-defined control code to a service. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • Create
  • The Create method creates a new service. The Win32_LoadOrderGroup parameter represents a grouping of system services defining execution dependencies. The services must be initiated in the order specified by the Load Order Group, as the services are dependent on each other. These dependent services require the presence of the antecedent services in order to function correctly. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • Change
  • The Change method modifies a service. The Win32_LoadOrderGroup parameter represents a grouping of system services defining execution dependencies. The services must be initiated in the order specified by the Load Order Group as the services are dependent on each other. These dependent services require the presence of the antecedent services in order to function correctly.
    Note: In order to use the Change method to change a service from network service to local system, the StartName and StartPassword input parameters should be given the following values:
    startname = "localsystem"
    startpassword = "" this is important, it needs to be an empty string, NOT null
    To change to network service:
    startname = "NT AUTHORITY\NetworkService"
    startpassword = ""
    The method returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • ChangeStartMode
  • The ChangeStartMode method modifies the StartMode of a service. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • Delete
  • The Delete method deletes an existing service. It returns one of the following integer values:
    0 - The request was accepted.
    1 - The request is not supported.
    2 - The user did not have the necessary access.
    3 - The service cannot be stopped because other services that are running are dependent on it.
    4 - The requested control code is not valid, or it is unacceptable to the service.
    5 - The requested control code cannot be sent to the service because the state of the service (Win32_BaseService:State) is equal to 0, 1, or 2.
    6 - The service has not been started.
    7 - The service did not respond to the start request in a timely fashion.
    8 - Unknown failure when starting the service.
    9 - The directory path to the service executable was not found.
    10 - The service is already running.
    11 - The database to add a new service is locked.
    12 - A dependency for which this service relies on has been removed from the system.
    13 - The service failed to find the service needed from a dependent service.
    14 - The service has been disabled from the system.
    15 - The service does not have the correct authentication to run on the system.
    16 - This service is being removed from the system.
    17 - There is no execution thread for the service.
    18 - There are circular dependencies when starting the service.
    19 - There is a service running under the same name.
    20 - There are invalid characters in the name of the service.
    21 - Invalid parameters have been passed to the service.
    22 - The account, which this service is to run under is either invalid or lacks the permissions to run the service.
    23 - The service exists in the database of services available from the system.
    24 - The service is currently paused in the system.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • GetSecurityDescriptor
  • Retrieves a structural representation of the service's security descriptor.
    The method returns an integer value that can be interpreted as follows:
    0 - Successful completion.
    2 - The user does not have access to the requested information.
    8 - Unknown failure.
    9 - The user does not have adequate privileges.
    21 - The specified parameter is invalid.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.

  • SetSecurityDescriptor
  • Sets security descriptor on the service to the specified structure.
    The method returns an integer value that can be interpreted as follows:
    0 - Successful completion.
    2 - The user does not have access to the requested information.
    8 - Unknown failure.
    9 - The user does not have adequate privileges.
    21 - The specified parameter is invalid.
    Other - For integer values other than those listed above, refer to Win32 error code documentation.


    Example WQL

    SELECT * FROM Win32_TerminalService
    About this site information

    This contents is created by WMI having class information.
    WMI Environment is Windows Server 2008 R2 Enterprise Edition.

    This link is Microsoft documents for "Managing Windows with WMI".
    That is VB(Visual Basic) scripting sample.
    This link is Microsoft documents for "Advanced Programming Topics in WMI .NET".
    That is VB.net(Visual Basic .net) scripting sample.

    - WMI Library -
    http://library.wmifun.net/

    WMI useful by VB,VB.Net,VC,VC.Net,VC#.Net,VBS(WSH),PowerShell for PC asset management, system monitoring and collecting hardware and software inventory.

    This website is created by Toh.
    Copyright(C) 1997-2016 WMI Fun !!. All rights reserved.
    ^ Go to the top...