2

Really stumped here and I'm sure the answer is simple. Simply put, I'm creating a bunch of AD accounts based on input from a spreadsheet. I've been able to concatenate the fields into a DSADD command that I run each time a new user is onboarded. For example:

@echo off    
dsadd user "CN=Bilbo Baggins,ou=Hobbiton,ou=Shire,ou=MiddleEarth,dc=lotr,dc=com" -fn Bilbo -ln Baggins -display "Bilbo Baggins" -upn [email protected] -pwd damnring! -email [email protected] -samid bbagins -mustchpwd no -disabled no

When I paste that into a cmd line and hit enter all is well, the AD account is created. I have hundreds of these - so I thought I would get fancy and put each of these commands on their own line and call it, oh, I don't know "add_all_users.bat". However when I call that from a command line or PS instance it errors out with "The syntax is incorrect".

What am I missing here?

1
  • I figured this out... it was all about my file extension. Once I added .ps1 to the file and ran it from PS, all was good. Oct 13, 2015 at 22:40

0

You must log in to answer this question.

Browse other questions tagged .