Then from a command-line, the following line should replace all entries in the LDIF file with value COMPUTERNAME with the TEST variable and save to a new ldif file. (We tested this on Linux using BASH)
Either set a variable or use $HOSTNAME (Which normally would be the "hostname -s" value)
TEST=ANEWHOST
Then execute:
sed 's/COMPUTERNAME/$TEST/' computer-account.ldif > $TEST.ldif
ldapadd -x -H ldap://adldap.YOURDOMAIN.net/ -D "CN=USERONE,OU=Sales,OU=Accounts,DC=YOURDOMAIN,DC=NET" -W -f $TEST.ldif
you should get a response like:
adding new entry "CN=ANEWHOST,OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET"
ldapsearch -x -H ldap://adldap.YOURDOMAIN.net/ -b "OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET" -D "CN=USERONE,OU=Sales,OU=Accounts,DC=YOURDOMAIN,DC=NET" -W -LLL 1.1
It will list the names like:
dn: OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET dn: CN=APC16S240b,OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET dn: CN=ANEWHOST,OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET
ldapdelete -x -H ldap://adldap.YOURDOMAIN.net/ -D "CN=USERONE,OU=Sales,OU=Accounts,DC=YOURDOMAIN,DC=NET" -W "CN=ANEWHOST,OU=AIX,OU=Servers,DC=YOURDOMAIN,DC=NET"
As the ldap utilities syntax varies from one host and version to another, these may need tweaking a bit.