Creating users can be tedious, especially when user information already resides in your company's HR system. Instead of manually creating a user and assigning passwords, you can use a script that accomplishes the same goal. The benefits: Fewer iterations of the information will result in fewer errors; you don't need to worry about whether or not a user account gets created; and, you can focus on more strategic IT tasks. This handy, VBScript will create users with passwords in Active Directory in the Users container.
I fixed it. I found out that it was the select statement in this script. The concatenation of sCSVfile with the select statement was not working right. Here is what I changed it to.
oInputRecordSet.open "SELECT * FROM example.csv", oInputConnection
Rather than calling the variable since that was not working right I put the name of the file in the select statement.
I also made a change to the oContainer getobject because I wanted to populate to an OU and not the users container.
Set oContainer = GetObject("LDAP://OU= Name,dc=example,dc=com")
Also this is a common error message -2147016657. It is in reference to exchange sLDAPExchangeServer or sLDAPhomeMDB. Check the values for these two variables again from the exchattrib.csv file. This error message is hard to find why this happens.
Here is one more change I made. The reason why I hard coded this was because again the concatenation of this line was not working write.
Look for section titled "' --------- Start creating user account ' Read variable information from the CSV file ' and build everything needed to create the account"
Then look that the value for each variable item(0) = column A item(1) = column B
I would hard code the variables in section titled ?Build and write the users Exchange attributes?. One of those variables is incorrect. Either it is the concatenation of that string or string is incorrectly formatted. Did you get your values from your csv dump of you ldap?
The script works when you carrefully add the correct variables, but it creates the mailboxes as legacy mailbox and I even dont have any legacy exchange server. Is there anybody with the same problem?
Collapse -
Set user account to not change passwords at next login
I have been trying to set the user accounts so they did not have to change their passwords at next login. We are setting this up for DR purposes and if you login over Outlook Web Access it does not give you the option to change your password at login. Here is what you need to set in the script to not have them change password at next login.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
DOWNLOA
Create users in Active Directory from a CSV file with VBScript
Download and try the script:
http://techrepublic.com.com/5138-10877-6019533.html
Join this ongoing discussion and let us know if this script is helpful and if there's anything we can do to improve the download's format or content.