def build_dseditgroup_command( params, dir_info )
      ans  = %Q[#{dir_info[:dsedit]}]
      ans += %Q[ -o #{params[:operation]}]
      ans += %Q[ -u #{dir_info[:username]}]    unless dir_info[:username].nil? or
                                                      dir_info[:username].empty?
      ans += %Q[ -P "#{dir_info[:password]}"]  unless dir_info[:password].nil? or
                                                      dir_info[:password].empty?
      ans += %Q[ -n #{dir_info[:data_path]}]
      if params[:operation].eql?('create')
        ans += %Q[ -r "#{params[:value]}"]         if params[:real_name].to_s.eql?('')
        ans += %Q[ -r "#{params[:real_name]}"] unless params[:real_name].to_s.eql?('')
        ans += %Q[ -k #{params[:keyword]}]     unless params[:keyword].to_s.eql?('')
      end
      ans += %Q[ -m #{params[:record_name]}]       if params[:operation].to_s.eql?('checkmember')
      if params[:operation].eql?('edit')
        ans += %Q[ -a #{params[:record_name]}]     if params[:action].to_s.eql?('add')
        ans += %Q[ -d #{params[:record_name]}]     if params[:action].to_s.eql?('delete')
        ans += %Q[ -t #{params[:type]}]            # type can be user or group
      end
      ans += %Q[ #{params[:value]}]   # the group to be manipulated
      params[:value] = nil
      return ans
    end
def build_dseditgroup_command( params, dir_info )
      ans  = %Q[#{dir_info[:dsedit]}]
      ans += %Q[ -o #{params[:operation]}]
      ans += %Q[ -u #{dir_info[:username]}]    unless dir_info[:username].nil? or
                                                      dir_info[:username].empty?
      ans += %Q[ -P "#{dir_info[:password]}"]  unless dir_info[:password].nil? or
                                                      dir_info[:password].empty?
      ans += %Q[ -n #{dir_info[:data_path]}]
      if params[:operation].eql?('create')
        ans += %Q[ -r "#{params[:value]}"]         if params[:real_name].to_s.eql?('')
        ans += %Q[ -r "#{params[:real_name]}"] unless params[:real_name].to_s.eql?('')
        ans += %Q[ -k #{params[:keyword]}]     unless params[:keyword].to_s.eql?('')
      end
      ans += %Q[ -m #{params[:record_name]}]       if params[:operation].to_s.eql?('checkmember')
      if params[:operation].eql?('edit')
        ans += %Q[ -a #{params[:record_name]}]     if params[:action].to_s.eql?('add')
        ans += %Q[ -d #{params[:record_name]}]     if params[:action].to_s.eql?('delete')
        ans += %Q[ -t #{params[:type]}]            # type can be user or group
      end
      ans += %Q[ #{params[:value]}]   # the group to be manipulated
      params[:value] = nil
      return ans
    end
http://www.manpagez.com/man/8/dseditgroup/
 make a new group:
 dseditgroup -o create -n /LDAPv3/ldap.company.com -u dir_admin_user -P dir_admin_passwd \
           -r "Real Group Name" -c "a comment" -k "keyword" groupname
 delete a new group:
 dseditgroup -o delete -n /LDAPv3/ldap.company.com -u dir_admin_user -P dir_admin_passwd groupname
 add a user to a group
 dseditgroup -o edit -n /LDAPv3/ldap.company.com -u dir_admin_user -P dir_admin_passwd -a username -t user groupname
 remove a user from a group
 dseditgroup -o edit -n /LDAPv3/ldap.company.com -u dir_admin_user -P dir_admin_passwd -d username -t user groupname