Export (0) Print
Expand All

IADsService interface

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.

Members

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

Methods

The IADsService interface has these methods.

MethodDescription
Get

Gets the value for a property by name.

GetEx

Gets the value for a single or multi-valued property by name.

GetInfo

Loads the property values of this object from the underlying directory store.

GetInfoEx

Loads specific property values of this object from the underlying directory store.

Put

Sets the value for a property by name.

PutEx

Sets the value for a single or multi-valued property by name.

SetInfo

Persists the changes on this object to the underlying directory store.

 

Properties

The IADsService interface has these properties.

PropertyAccess typeDescription

AdsPath

Read-only

Gets the object's ADsPath that uniquely identifies this object from all others.

Class

Read-only

Gets the name of the object's schema class.

Dependencies

Read/write

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

Read/write

Gets and sets the display name of this service.

ErrorControl

Read/write

Gets and sets the actions taken in case of service failure.

GUID

Read-only

Gets the GUID of the object as stored in the underlying directory store.

HostComputer

Read/write

Gets and sets the host of this service.

LoadOrderGroup

Read/write

Gets and sets the load order group for this service.

Name

Read-only

Gets the object's relative name.

Parent

Read-only

Gets the ADsPath string for the parent of the object.

Path

Read/write

Gets and sets the path and filename of the executable.

Schema

Read-only

Gets the ADsPath string to the schema class object for this object.

ServiceAccountName

Read/write

Gets and sets the authentication account name.

ServiceAccountPath

Read/write

Gets and sets the path to user object to authenticate.

ServiceType

Read/write

Gets and sets the process type in which this service runs.

StartType

Read/write

Gets and sets a value that determines how the service is started.

StartupParameters

Read/write

Gets and sets the parameters passed at start-up.

Version

Read/write

Gets and sets the version data of this service.

 

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

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsService is defined as 68AF66E0-31CA-11CF-A98A-00AA006BC149

See also

IADsServiceOperations
IADsFileService
IADsFileServiceOperations
IADsService Property Methods

 

 

Show:
© 2014 Microsoft