Hp-UX, SUSE, and AIX LDAP User Script Help

Hi,

I have been asked to create a ksh script that will search against an LDAP directory from various HP-UX, SUSE, and AIX 5.3 and 6.1 machines. The objective is to verify the boxes are successfully authenticating users from the LDAP store. This is something I've never done, and I could use some help. The output of this search is an xml file that lists all the machines that are connected in one list and all the machines that are not connected in another.
So to begin, I need a case statement or something that will check the server type. Then whatever needs to happen after that will go and run. I have to start with an AIX 5.3 machine for testing purposes, though the objective is to run them against a large pool of machines in a datacenter and get results from all regardless of OS.
The command to check the directory with AIX 5.3, my test machine, is:

lsldap �a passwd <ldap_user_ID>

If this user is visible from a particular machine, then we're good. I have a sample script that was used for something similar in the past, but it's not exactly what I need.

#search=/dev/fs/C/Users/%windows_username%/Desktop/test
#find $search/*/*/domains/* -name config.xml -type f -prune \
#    >w_xml_list 2>/dev/null
#
#find /usr/local/*/*/domains/* -name config.xml -type f -prune \
#    >w_xml_list 2>/dev/null


echo "Line to catch LDAP member status"

find /usr/local/*/*/domains/* -name config.xml -type f -prune \
    >w_xml_list 2>/dev/null

  if [ -s w_xml_list ]; then

    for config in $(cat w_xml_list)
    do

      if [ -s $config ]; then

    	  if [[ $(grep -ic 'iam' $config) != 0 ]];then
	  	  print "!!!:${HOSTNAME}:$config/hhld"
	    elif [[ $(grep -ic 'embedded' $config) != 0 ]];then
		  print "!!!:${HOSTNAME}:$config/embedded"
	    else
		  print "!!!:${HOSTNAME}:$config/NoMatch"
	  fi

        else

          print "!!!:${HOSTNAME}:$config/XmlNotFound"

      fi

    done

    #cat w_dom_list \
    #    | sed "s/^/!${HOSTNAME} /"

  else

    echo "!!!:${HOSTNAME}:NoWLSfound"

fi

rm w_xml_list

Is there anything in here that I can use to get started on AIX 5.3? I know I need to embed the lsldap command in there somewhere, and search for a user that I know exists in that ldap directory, but I don't know much else. Can anyone help me?

Thanks in advance,

D