servicesCollection object

The servicesCollection object represents a collection of Service objects.


The servicesCollection object has these types of members:


The servicesCollection object has these properties.

Property Access type Description
Gets the number of Service objects in the collection.


A servicesCollection object that contains all of the services on a device can be accessed through the Device.Services property. Specific services in the Device.Services collection can be retrieved by using either a zero-based numeric index or a Service Persistent Unique ID (PUID).

A servicesCollection object that is filtered by service type can be retrieved using the Device.GetServicesByType method. The services in a servicesCollection obtained from this method can only be accessed by a zero-based numeric index.


The following JScript example shows how to create a servicesCollection and enumerate the services in the collection, accessing them by index.

// Retrieve a collection of services from the device.
var services = deviceObject.GetServicesByType("ServiceTypeGUID");

// Enumerate the services in the collection and access them by index.
for (i=0; i < services.Count; i++)
    var aService = services[i]; 


Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

About the servicesCollection and storagesCollection Objects

Device Object

Service Object

WPD Automation Reference