diff --git a/src/python/dm/common/utility/ldapLinuxPlatformUtility.py b/src/python/dm/common/utility/ldapLinuxPlatformUtility.py
index 9f3e0b36a312d860e645908475426a05bc96f9b4..7371166de1fc7b2c240c810304bdebc282895de4 100755
--- a/src/python/dm/common/utility/ldapLinuxPlatformUtility.py
+++ b/src/python/dm/common/utility/ldapLinuxPlatformUtility.py
@@ -166,6 +166,38 @@ class LdapLinuxPlatformUtility:
             logger.error('Could not add user %s to group %s: %s' % (username, groupName, ex))
             raise InternalError(exception=ex)
 
+    def deleteUserFromGroup(self, username, groupName):
+        """ Remove user from group. """
+        logger = self.getLogger()
+        ldapClient = self.getLdapClient()
+        username = str(username)
+        groupName = str(groupName)
+        try:
+            groupDn = self.groupDnFormat % groupName
+            resultList = ldapClient.search_s(groupDn, ldap.SCOPE_BASE)
+            groupTuple = resultList[0]
+            groupAttrs = groupTuple[1]
+            memberUidList = groupAttrs.get('memberUid', [])
+            if username not in memberUidList:
+                logger.debug('Group %s does not contain user %s' % (groupName, username))
+                return
+        except Exception, ex:
+            raise InternalError(exception=ex)
+        logger.debug('Adding user %s to group %s' % (username, groupName))
+        memberUidList2 = copy.copy(memberUidList)
+        memberUidList2.remove(username)
+        groupAttrs2 = copy.copy(groupAttrs)
+        groupAttrs2['memberUid'] = memberUidList2
+        try:
+            groupLdif = ldap.modlist.modifyModlist(groupAttrs, groupAttrs2)
+            ldapClient.modify_s(groupDn, groupLdif)
+        except Exception, ex:
+            logger.error('Could not remove user %s from group %s: %s' % (username, groupName, ex))
+            raise InternalError(exception=ex)
+
+    @classmethod
+    def createLocalGroup(cls, name):
+        """ Create local group if it does not exist. """
     @classmethod
     def createLocalGroup(cls, name):
         """ Create local group if it does not exist. """
@@ -184,19 +216,12 @@ class LdapLinuxPlatformUtility:
     @classmethod
     def addLocalUserToGroup(cls, username, groupName):
         """ Add local user to group. """
-        cls.createLocalGroup(groupName)
-        logger = cls.getLogger()
-        logger.debug('Adding local user %s to group %s' % (username, groupName))
-        cmd = '%s -a %s %s' % (cls.GPASSWD_CMD, username, groupName)
-        cls.executeSudoCommand(cmd)
+        cls.addUserFromGroup(username, groupName)
 
     @classmethod
     def deleteLocalUserFromGroup(cls, username, groupName):
         """ Remove local user from group. """
-        logger = cls.getLogger()
-        logger.debug('Removing local user %s from group %s' % (username, groupName))
-        cmd = '%s -d %s %s' % (cls.GPASSWD_CMD, username, groupName)
-        cls.executeSudoCommand(cmd)
+        cls.deleteUserFromGroup(username, groupName)
 
     def getGroupInfo(self, groupName):
         """ Get given group info. """