views:

55

answers:

1

Using the SharePoint API (the one with the assemblies you add, but requires you to run on the server) it is easy to get audience members:

using (SPSite site = new SPSite("http://localhost"))
{
  ServerContext svrContext = ServerContext.GetContext(site);
  AudienceManager audManager = new AudienceManager(svrContext);
  foreach (Audience audience in audManager.Audiences)
  {
    ArrayList people = audience.GetMembership();
    if (people != null)
    {
      foreach (UserInfo user in people)
      {
        Console.WriteLine("send email to " + user.Email);
      }
    }       
}

However I can not find a web service to do the same thing?

A: 

Short answer, there is no web service :(

In the end I took the code from the question and built a web service myself and then use that.

Robert MacLean