It sounds like you have a mish mash of different values in the user's common name (CN) attribute. The CN is what is used in naming to build the user's DN (distinguishedName) which is what you use in GetObject.
The displayName and sAMAccountName attributes are different values and don't have to have any relation to the CN, so you can't assume that if you have one of those you can build the DN.
The bottom line is that you need to ensure that your script provides you the data you need to find the objects again later. As such, it is likely the best idea to deal in the distinguishedName attribute since you'll want that as input to GetObject later to make the modifications you want.
Having a provisioning system like ILM/FIM is also very helpful for ensuring that your user accounts are all provisioned consistently according to rules that you define rather than via manual input from the GUI.