Share via


Device.GetServicesByType method

The GetServicesByType method returns a collection of services for the specified service type.

Syntax

retVal = Device.GetServicesByType(
  ServiceTypeGUID
)

Parameters

ServiceTypeGUID

GUID in string form that uniquely identifies the service type. The format of the string must be "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".

Return value

Returns a servicesCollection object that contains all of the available services for the specified service type.

Remarks

For a full list of service type GUIDs, download the Windows Portable Device Enabling Kit.

Examples

The following JScript example uses the GetServicesByType method to retrieve a collection of "Contacts" services on a device, and then enumerates them.

// Retrieve a collection of Contacts services by using a ServiceTypeGUID.        
var contactsServices = deviceObject.GetServicesByType("{D0EACE0E-707D-4106-8D38-4F60E6A9F8E}");

// Enumerate all of the Contacts services.
for (i=0; i < contactsServices.Count; i++)
{
    var aContactsService = contactsServices[i];
}

Requirements

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

See also

Device Object

servicesCollection Object