For creating a computer object, we want to check if the entered CN is already used in our AD. And for that we want to use a powershell script.
An other dot is, if the entered CN is in used, so we want to add the next free number.
f.e.
we entered the CN = NBTEST
but the CN is in used, so the powershell script will check with adding number on CN which CN is availible.
checked:
NBTEST1
NBTEST2
...
after this check we know that the next possible CN is NBTEST3
But now we have the problem, that we dont know., how to use this "new" CN for adding the object to our AD.
the powershell script should be start before creating the computer object, right?
Thanks for your help.