PrepAway - Latest Free Exam Questions & Answers

Which code segment should you add?

User Profiles in your SharePoint farm contain the job title property. The job title property contains the user job title. You have an audience defined for the Sales department. The audience contains a rule. You create a custom application that contains the following code segment:

01: Using site as New SPSite.Open(“http://intranet”)
02: Dim context as ServerContext = ServerContext.GetContext(site)
03: Dim audienceMgr as New AudienceManager(context)
04: Dim audienceColl as AudienceCollection = audienceMgr.Audiences
05: Dim salesDepartmentAudience as Audience =
audienceColl.Open(“SalesDepartment”)
06: Dim salesDepartmentRules as ArrayList = salesDepartmentAudience.AudienceRules
07:
08:
09:
10:
11: salesDepartmentAudience.AudienceRules = salesDepartmentRules
12: salesDepartmentAudience.Commit()
13: End Using

You need to change the audience to include only the users that have the job title set to Manager.

Which code segment should you add?

PrepAway - Latest Free Exam Questions & Answers

A.
07: Dim mgrRule as New AudienceRuleComponent(“Manager”, “equals”, “true”)
08: salesDepartmentRules.Add(mgrRule)

B.
07: Dim mgrRule as New AudienceRuleComponent(“Manager”, “equals”, “true”).Open(“JobTitle”, “equals”, “Manager”)
08: salesDepartmentRules.Add(mgrRule)

C.
07: andRule as New AudienceRuleComponent(Nothing, “and”, Nothing)
08: Dim mgrRule as New AudienceRuleComponent(“Manager”, “equals”, “true”)
09: salesDepartmentRules.Add(andRule)
10: salesDepartmentRules.Add(mgrRule)

D.
07: andRule as New AudienceRuleComponent(Nothing, “and”, Nothing)
08: Dim mgrRule as New AudienceRuleComponent(“JobTitle”, “equals”, “Manager”)
09: salesDepartmentRules.Add(andRule)
10: salesDepartmentRules.Add(mgrRule)


Leave a Reply