nerdexam
Microsoft

70-573 · Question #128

You need to programmatically add a user named User1 to a group named Group1. You write the following code segment. (Line numbers are included for reference only.) 01 Dim login As String = "User1" 02…

The correct answer is A. group.AddUser(user). See the full explanation below for the reasoning.

Question

You need to programmatically add a user named User1 to a group named Group1. You write the following code segment. (Line numbers are included for reference only.) 01 Dim login As String = "User1" 02 Dim grpName As String = "Group1" 03 Dim user As SPUser = SPContext.Current.Web.EnsureUser(login) 04 Dim group As SPGroup = SPContext.Current.Web.Groups(grpName) 05 06 group.Update() Which code segment should you add at line 05?

Options

  • Agroup.AddUser(user)
  • Bgroup.Owner = user
  • Cuser.AllowBrowseUserInfo = True
  • Duser.Update()

How the community answered

(48 responses)
  • A
    73% (35)
  • B
    4% (2)
  • C
    15% (7)
  • D
    8% (4)

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice