C# and AXL 8.0 - adding a user to a group

Version 1
    This document was generated from CDN thread

    Created by: Erick Wellnitz on 14-04-2011 12:10:35 PM
    I use LDAP synch.  The problem is that when using the LDAP synch, when a new user is imported they are not a member of any groups.
     
    I can use UpdateUserReq to update the user for everything except group membership.  Has anyone been able to add a user to a group with C# and AXL 8.x?
     
    I'm probably making it too complicated again.
     
    Thanks in advance!

    Subject: Re: New Message from Erick Wellnitz in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 14-04-2011 05:44:25 PM
    I have had to use an SQLUpdate to set the userGroups in older cucm versions, but keep doing it still in 8.5, I have not tested the updateUser request

    <sql>insert into enduserdirgroupmap (fkenduser,fkdirgroup) values((select pkid from enduser where userid='myuserid'),(select pkid from dirgroup where name = 'Standard CCMUSER Administration'))</sql>

    hth
    Sascha

    Subject: RE: Re: New Message from Erick Wellnitz in Administration XML (AXL) - Admin
    Replied by: Erick Wellnitz on 14-04-2011 05:49:16 PM
    I'll give the SQL a whirl.  Looks like it will be easier than trying to figure out the UpdateUserGroup.

    Subject: Re: New Message from Erick Wellnitz in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 14-04-2011 06:01:25 PM
    I have just tested in 8.5, but now the updateUser with usergroups seems to work fine...

    <axl:updateUser xmlns:axl="http://www.cisco.com/AXL/API/8.5"  xsi:schemaLocation="http://www.cisco.com/AXL/API/8.5 http://ccmserver/schema/axlsoap.xsd" xsi:type="XRequest" sequence="1234"><userid>devuser53</userid><pin>50053</pin><associatedGroups><userGroup><name>Standard CCM End Users</name></userGroup></associatedGroups><phoneProfiles><profileName>UDP_devuser53</profileName></phoneProfiles><enableMobility>true</enableMobility></axl:updateUser>

    Subject: RE: C# and AXL 8.0 - adding a user to a group
    Replied by: Erick Wellnitz on 19-04-2011 09:07:53 PM
    This worked with one minor modification.

    insert into enduserdirgroupmap (fkenduser,fkdirgroup) values((select pkid from enduser where userid='myuserid'),(select pkid from dirgroup where name = 'Standard CCM User'))

    Thanks for the help!