0

I have a GUID for audiences. but I need the "AudienceName" to perform the another operation. how to I get the audienceName using AudienceID in c# code.

Please suggest any idea.

0
AudienceManager AudMgr = new AudienceManager();
Audience AudObj = AudMgr.GetAudience(new Guid(AudienceID));

if (AudObj != null)
{
    System.Console.WriteLine("Audience Name {0}", AudObj.AudienceName);
}

Reference : https://msdn.microsoft.com/en-us/library/office/ms498416.aspx

  • I am having an "Access Denied" error in "Audience AudObj = AudMgr.GetAudience(new Guid(AudienceID));" code. i used the 'run with elevated permission' also it says "Access Denied". please provide any idea. – PGP Jan 17 '17 at 14:14
  • please refer this link that i have come across. This may help you out. --> mariuszgorzoch.wordpress.com/2011/04/18/… – Rohit Waghela Jan 17 '17 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.