IUccContainerMembershipManager.TryFindContainerMember Method

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.

Attempts to find a container member.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Function TryFindContainerMember ( _
    bstrUri As String, _
    enScope As UCC_CONTAINER_MEMBERSHIP_SCOPE, _
    enMatchingType As UCC_CONTAINER_MEMBER_MATCHING_TYPE, _
    <OutAttribute> ByRef ppContainerMember As IUccContainerMember _
) As Boolean
bool TryFindContainerMember (
    string bstrUri,
    UCC_CONTAINER_MEMBERSHIP_SCOPE enScope,
    UCC_CONTAINER_MEMBER_MATCHING_TYPE enMatchingType,
    out IUccContainerMember ppContainerMember
)
bool TryFindContainerMember (
    String^ bstrUri, 
    UCC_CONTAINER_MEMBERSHIP_SCOPE enScope, 
    UCC_CONTAINER_MEMBER_MATCHING_TYPE enMatchingType, 
    [OutAttribute] IUccContainerMember^% ppContainerMember
)
boolean TryFindContainerMember (
    String bstrUri, 
    UCC_CONTAINER_MEMBERSHIP_SCOPE enScope, 
    UCC_CONTAINER_MEMBER_MATCHING_TYPE enMatchingType, 
    /** @attribute OutAttribute() */ /** @ref */ IUccContainerMember ppContainerMember
)

Parameters

  • bstrUri
    A value of the BSTR (string, for a .NET application) type. This specifies the SIP URI of a user ("sip:joe@contoso.com") or a network domain ("sip:contoso.com"). Set this to NULL if the enScope parameter is other than UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_USER or UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_DOMAIN.
  • enScope
    A value of the UCC_CONTAINER_MEMBERSHIP_SCOPE type. This specifies a container membership scope defining a type of user permitted to access the container. For the scope of UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_USER or UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_DOMAIN, the SIP URI must also be explicitly specified in bstrUri.
  • ppContainerMember
    A value of the IUccContainerMember** (IUccContainerMember, for a .NET application) type. This returns the specified container member if it exists and returns NULL if the container member does not exist.

Return Value

A value of the VARIANT_BOOL* (bool, for a .NET application) type. This returns TRUE if the container member exist and is thus found. It returns FALSE otherwise.

Remarks

This method can be used to determined whether a container member already exists. It returns the container member if it exists. Otherwise it returns FALSE and the pointer to IUccContainerMember points to NULL. When the IUccContainerMemberout parmeter is not null, an application can use that interface reference to determine which containers hold the user represented by the passed Uri string.

Win32 COM/C++ Syntax

HRESULT TryFindContainerMember
(
   BSTR bstrUri,
   UCC_CONTAINER_MEMBERSHIP_SCOPE enScope,
   UCC_CONTAINER_MEMBER_MATCHING_TYPE enMatchingType,
   IUccContainerMember** ppContainerMember,
   VARIANT_BOOL* pbFound
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example creates a reference to a container member by calling TryFindContainerMember and passes parameters appropriate to search for an individual user. If a container member is found, the container scope and container Id's of owning containers are displayed on a local user's system console.

If (this.cmm.TryFindContainerMember(
      "SIP:jaya@contoso.com",
      UCC_CONTAINER_MEMBERSHIP_SCOPE
      .UCCCMS_EVERYONE,
      UCC_CONTAINER_MEMBER_MATCHING_TYPE
      .UCCCMMT_BEST,
      out cm) == true)
{
   Console.WriteLine("Scope: " + cm.Scope.ToString());
   StringBuilder sb = new StringBuilder();
   foreach (IUccContainer ct in cm.Containers)
   {
      sb.Append(ct.Id.ToString()+ " ");
   }
   Console.WriteLine("Containers: " + sb.ToString());
}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

IUccContainerMembershipManager Interface
IUccContainerMembershipManager Members
Microsoft.Office.Interop.UccApi Namespace