IADsService Property Methods

The property methods of the IADsService interface read and write the properties described in this topic. For more information, see Interface Property Methods.

Properties

Dependencies

Array of BSTR names of services or load groups that must be loaded for this service to load. The syntax for the entry is "Service:" followed by the service name or "Group:" followed by the load group name.

Access type: Read/write

Scripting data type: VARIANT

// C++ method syntax
HRESULT get_Dependencies(
  [out] VARIANT* pvServiceDepend
);
HRESULT put_Dependencies(
  [in] VARIANT vServiceDepend
);

DisplayName

The friendly name of the service.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_DisplayName(
  [out] BSTR* pbstrDisplayName
);
HRESULT put_DisplayName(
  [in] BSTR bstrDisplayName
);

ErrorControl

The action to be performed if this service fails on startup. The following are valid values for this property.

ADS_SERVICE_ERROR_IGNORE

The startup program logs the error, but continues the startup operation.

ADS_SERVICE_ERROR_NORMAL

The startup program logs the error and presents a message box, but continues the startup operation.

ADS_SERVICE_ERROR_SEVERE

The startup program logs the error. If the last-known-good configuration is started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration.

ADS_SERVICE_ERROR_CRITICAL

The startup program logs the error, if possible. If the last-known-good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_ErrorControl(
  [out] LONG* plErrorControl
);
HRESULT put_ErrorControl(
  [in] LONG lErrorControl
);

HostComputer

The ADsPath string of the host of this service.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_HostComputer(
  [out] BSTR* pbstrHostComputer
);
HRESULT put_HostComputer(
  [in] BSTR bstrHostComputer
);

LoadOrderGroup

Name of the load order group that this service is a member.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_LoadOrderGroup(
  [out] BSTR* pbstrLoadOrderGroup
);
HRESULT put_LoadOrderGroup(
  [in] BSTR bstrLoadOrderGroup
);

Path

Path and filename to the executable of this service.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Path(
  [out] BSTR* pbstrPath
);
HRESULT put_Path(
  [in] BSTR bstrPath
);

ServiceAccountName

Name of the account that this service uses to authenticate itself on startup.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_ServiceAccountName(
  [out] BSTR* pbstrServiceAccountName
);
HRESULT put_ServiceAccountName(
  [in] BSTR bstrServiceAccountName
);

ServiceAccountPath

Path of the account specified by the ServiceAccountPath property.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_ServiceAccountPath(
  [out] BSTR* pbstrServiceAccountPath
);
HRESULT put_ServiceAccountPath(
  [in] BSTR bstrServiceAccountPath
);

ServiceType

The description of how a service presents itself on the host computer. This property can be zero or a combination of one or more of the following values.

ADS_SERVICE_KERNEL_DRIVER (0x00000001)

ADS_SERVICE_FILE_SYSTEM_DRIVER (0x00000002)

ADS_SERVICE_OWN_PROCESS (0x00000010)

ADS_SERVICE_SHARE_PROCESS (0x00000020)

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_ServiceType(
  [out] LONG* plServiceType
);
HRESULT put_ServiceType(
  [in] LONG lServiceType
);

StartType

Determines how to start the service. The following are valid values for this property.

ADS_SERVICE_BOOT_START

The service is a device driver started by the system loader. This value is valid only for driver services.

ADS_SERVICE_SYSTEM_START

The service is a device driver started by the IoInitSystem function. This value is valid only for driver services.

ADS_SERVICE_AUTO_START

The service will be started automatically by the service control manager during system startup.

ADS_SERVICE_DEMAND_START

The service will be started by the service control manager when a process calls the StartService function.

ADS_SERVICE_DISABLED

The service cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED.

Access type: Read/write

Scripting data type: LONG

// C++ method syntax
HRESULT get_StartType(
  [out] LONG* plStartType
);
HRESULT put_StartType(
  [in] LONG lStartType
);

StartupParameters

Parameters passed to the service at startup.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_StartupParameters(
  [out] BSTR* pbstrStartupParameters
);
HRESULT put_StartupParameters(
  [in] BSTR bstrStartupParameters
);

Version

Version of the service.

Access type: Read/write

Scripting data type: BSTR

// C++ method syntax
HRESULT get_Version(
  [out] BSTR* pbstrVersion
);
HRESULT put_Version(
  [in] BSTR bstrVersion
);

Examples

The following code example shows how to list all the available system services running on the host computer, "myMachine", together with the location to find the executables of the services.

Dim cp As IADsComputer
On Error GoTo Cleanup

Set cp = GetObject("WinNT://myMachine,computer")
If (IsEmpty(cp) = False) Then
    cp.Filter = Array("Service")
    For Each service In cp
        MsgBox service.Name & " @" & service.path
    Next
End if

Cleanup:
    If (Err.Number<>0) Then
        MsgBox("An error has occurred. " & Err.Number)
    End If
    Set cp = Nothing

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Iads.h
DLL
Activeds.dll
IID
IID_IADsService is defined as 68AF66E0-31CA-11CF-A98A-00AA006BC149

See also

IADsService

Interface Property Methods