Share via


AudienceManager.GetUserAudienceIDs Method (Boolean)

Gets a list of globally unique identifiers (GUIDs) for the audiences to which the current user belongs.

Namespace:  Microsoft.Office.Server.Audience
Assembly:  Microsoft.Office.Server (in Microsoft.Office.Server.dll)

Syntax

'Declaration
Public Function GetUserAudienceIDs ( _
    needAudienceName As Boolean _
) As ArrayList
'Usage
Dim instance As AudienceManager
Dim needAudienceName As Boolean
Dim returnValue As ArrayList

returnValue = instance.GetUserAudienceIDs(needAudienceName)
public ArrayList GetUserAudienceIDs(
    bool needAudienceName
)

Parameters

Return Value

Type: System.Collections.ArrayList
System.Collections.ArrayList object that represents a list of GUIDs for audiences to which the current user belongs.

Remarks

The GetUserAudienceIDs method identifies the current user by retrieving the security identifier (SID) for the current user from Windows Server 2003. Account information such as Windows NT user name and domain are used to retrieve audience information from the database.

Examples

The following code example shows how to use the GetUserAudienceIDs method to retrieve and list GUIDs for audiences to which the current user belongs.

AudienceManager AudMgr = new AudienceManager();
ArrayList IDList = AudMgr.GetUserAudienceIDs();
System.Console.WriteLine("User Audience GUIDs");

for (int info=0; info<IDList.Count; info++)
{
    System.Console.WriteLine(((Guid)IDList[info]).ToString());
}

See Also

Reference

AudienceManager Class

AudienceManager Members

GetUserAudienceIDs Overload

Microsoft.Office.Server.Audience Namespace