This documentation is archived and is not being maintained.


This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Retrieves the service ID, a globally unique identifier (GUID), of the primary service to which the local client user is currently signed in. Scriptable.

HRESULT MyServiceId(
   retval] BSTR* pbstrServiceId


Return value. Pointer to a BSTR that contains a GUID that uniquely identifies the service that the local client user uses.

Returns one of the following values. For managed code applications, these return values are received in the form of a COMException.




A general failure occurred.

It is recommended to avoid using the IMessenger::MyServiceId property, but use IMessengerService::ServiceID property instead. To return a list of MessengerService objects, use the IMessenger::Services property.

If the local client is offline, this method returns the service ID of the default service.

This example code reads the MyServiceId property of an IMessenger interface object, communicator. The returned string is displayed on the application console screen.

if (communicator != null)
       communicatorServiceID = communicator.MyServiceId;
       Console.WriteLine("Communicator Service ID:" + communicatorServiceID.Trim());
   catch (COMException MSCE)


Requires Microsoft DirectX 9.0, C Runtime libraries (msvcm80.dll) on Microsoft Windows© Vista, Microsoft Windows XP Service Pack 1 (SP1) or later, or Microsoft Windows 2000 with Service Pack 4 (SP4). Any Communicator-imposed restrictions apply. .


Requires Microsoft Office Communications Server 2007, AV MCU (for Media Support), Media Relay (for NAT/Firewall traversal) on Microsoft Office Communications Server 2007.


Microsoft Office Communicator 2007 Automation API

IDL file