Directory Services |
The IADsService interface is a dual interface that inherits from IADs. It is designed to maintain data about system services running on a host computer. Examples of such services include "FAX" for Microsoft Fax Service, "RemoteAccess" for Routing and RemoteAccess Service, and "seclogon" for Secondary Logon Service. Examples of the data about any system service include the path to the executable file on the host computer, the type of the service, other services or load group required to run a particular service, and others. IADsService exposes several properties to represent such data.
The IADsService interface inherits the methods of the standard COM interfaces:
In addition, IADsService defines the following methods.
Method | Description |
---|---|
get_HostComputer | Gets and sets the host of this service. |
put_HostComputer | Gets and sets the host of this service. |
get_DisplayName | Gets and sets the display name of this service. |
put_DisplayName | Gets and sets the display name of this service. |
get_Version | Gets and sets the version data of this service. |
put_Version | Gets and sets the version data of this service. |
get_ServiceType | Gets and sets the process type in which this service runs. |
put_ServiceType | Gets and sets the process type in which this service runs. |
get_StartType | Gets a value that determines how the service is started. |
put_StartType | Sets a value that determines how the service is started. |
get_Path | Gets and sets the path and filename of the executable. |
put_Path | Gets and sets the path and filename of the executable. |
get_StartupParameters | Gets and sets the parameters passed at start-up. |
put_StartupParameters | Gets and sets the parameters passed at start-up. |
get_ErrorControl | Gets and sets the actions taken in case of service failure. |
put_ErrorControl | Gets and sets the actions taken in case of service failure. |
get_LoadOrderGroup | Gets and sets the load order group for this service. |
put_LoadOrderGroup | Gets and sets the load order group for this service. |
get_ServiceAccountName | Gets and sets the authentication account name. |
put_ServiceAccountName | Gets and sets the authentication account name. |
get_ServiceAccountPath | Gets and sets the path to user object to authenticate. |
put_ServiceAccountPath | Gets and sets the path to user object to authenticate. |
get_Dependencies | Gets and sets the array of BSTR names of services or load groups that must be loaded in order for this service to load. |
put_Dependencies | Gets and sets the array of BSTR names of services or load groups that must be loaded in order for this service to load. |
The IADsService interface defines the following properties. The preceding table includes access methods for these properties.
Property | Description |
---|---|
Dependencies | Gets and sets the array of BSTR names of services or load groups that must be loaded in order for this service to load. |
DisplayName | Gets and sets the display name of this service. |
ErrorControl | Gets and sets the actions taken in case of service failure. |
HostComputer | Gets and sets the host of this service. |
LoadOrderGroup | Gets and sets the load order group for this service. |
Path | Gets and sets the path and filename of the executable. |
ServiceAccountName | Gets and sets the authentication account name. |
ServiceAccountPath | Gets and sets the path to user object to authenticate. |
ServiceType | Gets and sets the process type in which this service runs. |
StartType | Gets and sets a value that determines how the service is started. |
StartupParameters | Gets and sets the parameters passed at start-up. |
Version | Gets and sets the version data of this service. |
To identify services available on a host computer, first bind to the computer and then enumerate the services available on that computer. See the following code example.
Dim comp as IADsComputer On Error GoTo Cleanup Set comp = GetObject("WinNT://aComputer,Computer") comp.Filter = Array("Service") For Each srvc in comp MsgBox srvc.Name & ", " & srvc.status Next Cleanup: If (Err.Number<>0) Then MsgBox("An error has occurred. " & Err.Number) End If Set comp = Nothing
The system services are published in the underlying directory. Some may be running, others may not. To verify the status or to operate on any of the services, use the properties and methods of the IADsServiceOperations interface.
File service is a special case of the system service. The IADsFileService and IADsFileServiceOperations interfaces support additional features unique to file services.
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.
IADsServiceOperations, IADsFileService, IADsFileServiceOperations, IADsService Property Methods