SharePoint Tips

Thursday, November 16, 2017

C# - Retrieve information for audiences associated with a SharePoint site

AudienceCollection Audiences;
AudienceManager AudMgr = New AudienceManager();
Audiences = AudMgr.Audiences;

for (int list=0; list < Audiences.Count; list++)
{
    System.Console.WriteLine("{0}", list);
    Audience = (Audience)Audiences[list];
    System.Console.WriteLine("  Audience.Count ", Audience.Count);
    System.Console.WriteLine("  Audience.AudienceCompiledSofar ", Audience.AudienceCompiledSofar);
    System.Console.WriteLine("  Audience.LastCompileStartTime ", Audience.LastCompileStartTime);
    System.Console.WriteLine("  Audience.LastCompileStartTime ", Audience.LastCompileFinishTime);
    System.Console.WriteLine("  Audience.LastCompileError ", Audience.LastCompileError);
    System.Console.WriteLine("  Audience.CompileInProgress ", Audience.CompileInProgress);
}
System.Console.WriteLine("End");

No comments:

Post a Comment