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)- A73% (35)
- B4% (2)
- C15% (7)
- D8% (4)
Community Discussion
No community discussion yet for this question.