Platform SDK: Active Directory, ADSI, and Directory Services

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 in Vtable Order

Property Description
Dependencies

[Visual Basic]
Access: Read/Write
Data Type: VARIANT

[C++]
HRESULT get_Dependencies
([out] VARIANT *pvServiceDepend);


HRESULT put_Dependencies
([in] VARIANT vServiceDepend);

Array of BSTR names of services or load groups that must be loaded in order 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.
DisplayName

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_DisplayName
([out] BSTR *pbstrDisplayName);


HRESULT put_DisplayName
([in] BSTR bstrDisplayName);

The friendly display name of the service.
ErrorControl

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_ErrorControl
([out] LONG *plErrorControl);


HRESULT put_ErrorControl
([in] LONG lErrorControl);

Action that should be taken if this service fails on startup. Valid values are:
  ADS_SERVICE_ERROR_IGNORE
ADS_SERVICE_ERROR_NORMAL
ADS_SERVICE_ERROR_SEVERE
ADS_SERVICE_ERROR_CRITICAL
0x00000000
0x00000001
0x00000002
0x00000003
HostComputer

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_HostComputer
([out] BSTR *pbstrHostComputer);


HRESULT put_HostComputer
([in] BSTR bstrHostComputer);

The ADsPath string of the host of this service.
LoadOrderGroup

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_LoadOrderGroup
([out] BSTR *pbstrLoadOrderGroup);


HRESULT put_LoadOrderGroup
([in] BSTR bstrLoadOrderGroup);

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

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_Path
([out] BSTR *pbstrPath);


HRESULT put_Path
([in] BSTR bstrPath);

Path and filename to the executable of this service.
ServiceAccountName

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_ServiceAccountName
([out] BSTR *pbstrServiceAccountName);


HRESULT put_ServiceAccountName
([in] BSTR bstrServiceAccountName);

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

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_ServiceAccountPath
([out] BSTR *pbstrServiceAccountPath);


HRESULT put_ServiceAccountPath
([in] BSTR bstrServiceAccountPath);

Path of the account specified by the ServiceAccountName property.
ServiceType

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_ServiceType
([out] LONG *plServiceType);


HRESULT put_ServiceType
([in] LONG lServiceType);

The description of how a service manifests itself on the host computer. ServiceType is a bit mask that can contain the logical OR of the supported service type constant values. Valid values are as follows:
  ADS_SERVICE_KERNEL_DRIVER
ADS_SERVICE_FILE_SYSTEM_DRIVER
ADS_SERVICE_OWN_PROCESS
ADS_SERVICE_SHARE_PROCESS
0x00000001
0x00000002
0x00000010
0x00000020
StartType

[Visual Basic]
Access: Read/Write
Data Type: LONG

[C++]
HRESULT get_StartType
([out] LONG *plStartType);


HRESULT put_StartType
([in] LONG lStartType);

The type you should use to start this service. Valid types are defined as follows and are derived from the appropriate Win32 SERVICE_XXX constants.
  ADSI Service Start Type
ADS_SERVICE_BOOT_START
ADS_SERVICE_SYSTEM_START
ADS_SERVICE_AUTO_START
ADS_SERVICE_DEMAND_START
ADS_SERVICE_DISABLED
Win32 Service Start Type
ADS_SERVICE_BOOT_START
ADS_SERVICE_SYSTEM_START
ADS_SERVICE_AUTO_START
ADS_SERVICE_DEMAND_START
ADS_SERVICE_DISABLED
StartupParameters

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_StartupParameters
([out] BSTR *pbstrStartupParameters);


HRESULT put_StartupParameters
([in] BSTR bstrStartupParameters);

Parameters passed to the service on startup.
Version

[Visual Basic]
Access: Read/Write
Data Type: BSTR

[C++]
HRESULT get_Version
([out] BSTR *pbstrVersion);


HRESULT put_Version
([in] BSTR bstrVersion);

Version information of the service.

Example Code [Visual Basic]

The following Visual Basic code snippet illustrates how to list all the available system services running on the host machine, "myMachine", together with the location to find the executables of the services.

Dim cp as IADsComputer
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

See Also

IADsService, Interface Property Methods