Hey everyone! I'm working on a script that uses a CSV file to create new Active Directory users. I'm having trouble with the display name variable. I've set it up like this: $DisplayName = "($user.'FIRST NAME') + ($user.'LAST NAME')". Can anyone help me understand why it's not functioning as expected?
1 Answer
What error message are you seeing? It's tough to help without knowing the exact code you're using to create the user. There might be an issue with how you're trying to expand the variables in your string, so sharing a bit more detail would really help us assist you better.

I’m getting a 'positional parameter cannot be found' error related to the last name. I use New-ADUser -DisplayName $DisplayName for the display name, and the rest is pretty straightforward with the name, email, and username.