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
-
-
Access type: Read/write
-
Scripting data type: VARIANT
-
// C++ method syntax 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 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
-
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_DisplayName( [out] BSTR* pbstrDisplayName ); HRESULT put_DisplayName( [in] BSTR bstrDisplayName );
The friendly name of the service.
-
-
ErrorControl
-
-
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.
The action to be performed if this service fails on startup. The following are valid values for this property.
-
-
Access type: Read/write
-
Scripting data type: LONG
-
// C++ method syntax HRESULT get_ErrorControl( [out] LONG* plErrorControl ); HRESULT put_ErrorControl( [in] LONG lErrorControl );
HostComputer
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_HostComputer( [out] BSTR* pbstrHostComputer ); HRESULT put_HostComputer( [in] BSTR bstrHostComputer );
The ADsPath string of the host of this service.
LoadOrderGroup
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_LoadOrderGroup( [out] BSTR* pbstrLoadOrderGroup ); HRESULT put_LoadOrderGroup( [in] BSTR bstrLoadOrderGroup );
Name of the load order group that this service is a member.
Path
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Path( [out] BSTR* pbstrPath ); HRESULT put_Path( [in] BSTR bstrPath );
Path and filename to the executable of this service.
ServiceAccountName
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax 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
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_ServiceAccountPath( [out] BSTR* pbstrServiceAccountPath ); HRESULT put_ServiceAccountPath( [in] BSTR bstrServiceAccountPath );
Path of the account specified by the ServiceAccountPath property.
ServiceType
-
ADS_SERVICE_KERNEL_DRIVER (0x00000001)
-
ADS_SERVICE_FILE_SYSTEM_DRIVER (0x00000002)
-
ADS_SERVICE_OWN_PROCESS (0x00000010)
-
ADS_SERVICE_SHARE_PROCESS (0x00000020)
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.
Access type: Read/write
Scripting data type: LONG
// C++ method syntax
HRESULT get_ServiceType(
[out] LONG* plServiceType
);
HRESULT put_ServiceType(
[in] LONG lServiceType
);
StartType
-
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.
Determines how to start the service. The following are valid values for this property.
Access type: Read/write
Scripting data type: LONG
// C++ method syntax
HRESULT get_StartType(
[out] LONG* plStartType
);
HRESULT put_StartType(
[in] LONG lStartType
);
StartupParameters
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_StartupParameters( [out] BSTR* pbstrStartupParameters ); HRESULT put_StartupParameters( [in] BSTR bstrStartupParameters );
Parameters passed to the service at startup.
Version
-
Access type: Read/write
-
Scripting data type: BSTR
-
// C++ method syntax HRESULT get_Version( [out] BSTR* pbstrVersion ); HRESULT put_Version( [in] BSTR bstrVersion );
Version of the service.
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 |
|
DLL |
|
IID |
IID_IADsService is defined as 68AF66E0-31CA-11CF-A98A-00AA006BC149 |