Need Help with Scripting for Creating New AD Users

0
2
Asked By CuriousCoder87 On

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

Answered By TechWhiz99 On

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.

NewbieNerd22 -

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.