Adds a user to the specified user group.

Syntax

Visual Basic (declaration)
Public Function AddUsergroupMember( _ 
ByVal AuthenticationTicket as String, _ ByVal DomainName as String, _ ByVal GroupName as String, _ ByVal UserName as String) as XmlNode

C# (declaration)
public XmlNode AddUsergroupMember( 
string AuthenticationTicket, string DomainName, string GroupName, string UserName)

Parameters

AuthenticationTicket
    string inforouter ticket
DomainName
    string The domain name of the usergroup if it is local
GroupName
    string The group name of group the user to be added
UserName
    string The user name to be added to the group

Return Value

returns xml fragment.
<response success="true" error="">
if success = "true", the user has been added to the group successfully
if success = "false", the error attribute returns the error description.

Remarks

The caller must be the system administrator or the domain manager of local usergroup.

minus gif Example

Visual Basic Example
Public Function AddUsergroupMember()
        Const RAuthenticationTicket As String = "sid-xxxxxxxxxx"
        Const IR_DomainName As String = "Knowledge Base"
        Const IR_UserGroup As String = "Authors"
        Const IR_UserName As String = "JoeD"
 
        Dim IR_Obj As InfoRouter.srv
        Dim xmlResponse As System.Xml.XmlElement
        Try
 
            IR_Obj = New InfoRouter.srv
            xmlResponse = IR_Obj.AddUsergroupMember(IRAuthenticationTicket, _
                                                    IR_PWD, _
                                                    IR_DomainName, _
                                                    IR_UserGroup, _
                                                    IR_UserName)
 
           If xmlResponse.GetAttribute("success") = "true" Then
                Console.WriteLine("The user added to the user group")
            Else
                Console.WriteLine("The User cannot be added to the group.")
                Console.WriteLine("server response:" & xmlResponse.GetAttribute("error"))
            End If
            xmlResponse = Nothing
 
        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
        Finally
            IR_Obj = Nothing
        End Try
    End Sub