Thank you William,
Your reply also answeres a question but I need to take this a step further. I need to be able to get a list of all the users in "Role A" as you described above. Then I need to be able to add all of thos users to "Role B" for a period of 7 days from the current day. Lastly I need to send each of thos users a email using the email address on their profile.
Something like:
Dim objRoles As New RoleController()
Dim UserName1 As String = Coach.Text
Dim user As UserInfo = UserController.GetUserByName(Me.PortalId, UserName1)
Dim userId As Integer = user.UserID
Dim objRoleController As DotNetNuke.Security.Roles.RoleController
objRoleController = New DotNetNuke.Security.Roles.RoleController
Dim objRoleInfo As RoleInfo = objRoles.GetRoleByName(PortalSettings.PortalId, CoachRoleName)
objRoleController.AddUserRole(Me.PortalId, userId, objRoleInfo.RoleID, Null.NullDate, Null.NullDate)
'Send email notifying video's available
Dim userEmail1 As String = UserController.GetUserByName(Me.PortalId, UserName1).Email
Dim message As New MailMessage()
Dim client As New SmtpClient
Dim commentDate As String = format(Now(), "R")
Dim textBody As String = "E-Mail Text"
Dim textView As AlternateView = AlternateView.CreateAlternateViewFromString(textBody, Nothing, "text/plain")
Try
Dim FromEmail As String = "site@****.com"
Dim ToEmail As String = userEmail1
message.AlternateViews.Add(textView)
message.Subject = "Subject"
message.From = New MailAddress(FromEmail)
message.To.Add(ToEmail)
client.Send(message)