I currently have a script that creates new AD accounts with a Display Name that is there employeeNumber. As the script runs and sets attributes the Display Name will be changed to their real name. My issue is if the new AD account is John Smith and I already have a John Smith the AD account will not be renamed as there is already an object with that name in the AD folder.
How would I add some coding that if the rename fails it would add their middle initial ex John Smith A?
Would a whatif statement help?
Any Ideas?