I’m trying to write a script to help with user AD account creation. (Import-CSV and New-ADUser)
One of the CSV file headers is ‘Area Number’. The column’s cell contents will contain only either a 1, 2 or 3 (and unfortunately not ‘Area1’, ‘Area2’ or ‘Area3’). The format of the input CSV file can’t be changed.
I’m trying to set the -path parameter to place the new user in the correct OU:
However, I can’t get the first part (ou=Area) to work. I’ve tried variations of:
‘ou=Area + $_.“Area Number”,ou=suppliers,ou=Europe,dc=company,dc=com’
I’ve messed around with the positioning of the quotes and the ‘+’ symbol (including and omitting it).
I’m sure this is something simple that I’m going to kick myself over.
Please put me out of my misery!