IADsService interface (iads.h)

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.

Inheritance

The IADsService interface inherits from IDispatch and IADs. IADsService also has these types of members:

Remarks

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.

Examples

To identify services available on a host computer, first bind to the computer and then enumerate the services available on that computer. The following code example shows how to do this.

Public Sub ListServicesOnComputer(ComputerName As String)
    Dim comp As IADsComputer
    Dim srvc As IADsServiceOperations
    
    On Error GoTo Cleanup
    
    Set comp = GetObject("WinNT://" + ComputerName + ",Computer")
    comp.Filter = Array("Service")
    For Each srvc In comp
        ' The srvc object is an IADsServiceOperations object that can be 
        ' used to obtain the status of the service with the Status property. 
        ' Other IADs properties can also be obtained.
    Next
    
Cleanup:
    If (Err.Number <> 0) Then
        MsgBox (Err.Description & vbLf & vbLf & " Error number = " & Err.Number)
    End If
    Set comp = Nothing
End Sub

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header iads.h

See also

IADs

IADsFileService

IADsFileServiceOperations

IADsService Property Methods

IADsServiceOperations

IDispatch