Platform SDK: Active Directory, ADSI, and Directory Services

IADsService

The IADsService interface is designed for maintaining the information 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 information 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 information.

To find out services available on a host computer, you must first bind to the computer and then enumerate through the service available on that machine. This procedure is shown in the following code fragment:

Dim comp as IADsComputer
Set comp = GetObject("WinNT://aComputer,Computer")
comp.Filter = Array("Service")
For Each srvc in comp
    MsgBox srvc.Name & ", " & srvc.status
Next

The system services are published in the underlying directory. Some may be running, others may not. To check 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 functionality unique to file services.

IADsService is a dual interface that inherits from IADs. The IADsService interface exposes the following property methods.

Methods in Vtable Order

IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IDispatch methods Description
GetTypeInfoCount Gets the number of type descriptions.
GetTypeInfo Gets a description of object's programmable interface.
GetIDsOfNames Maps name of method or property to DISPID.
Invoke Calls one of the object's methods, or gets and sets one of its properties.

IADsService property methods Description
get/put_HostComputer Gets and sets the host of this service.
get/put_DisplayName Gets and sets the display name of this service.
get/put_Version Gets and sets the version information of this service.
get/put_ServiceType Gets and sets the process type in which this service runs.
get/put_StartType Gets and sets the type for how this service starts.
get/put_Path Gets and sets the path and filename of the executable.
get/put_StartupParameters Gets and sets the parameters passed at start-up.
get/put_ErrorControl Gets and sets the actions taken in case of service failure.
get/put_LoadOrderGroup Gets and sets the load order group for this service.
get/put_ServiceAccountName Gets and sets the authentication account name.
get/put_ServiceAccountPath Gets and sets the path to user object to be authenticated.
get/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.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADsServiceOperations, IADsFileService, IADsFileServiceOperations, IADsService Property Methods