troubleshooting Question

Leading Zero in Password Field of Active Directory via import not working correctly...

Avatar of CecilAdmin
CecilAdminFlag for United States of America asked on
Active Directory
3 Comments1 Solution509 ViewsLast Modified:
^I have used this script to create accounts without an issue.

An import of a .csv with username, fname, lname, password, and id complete successfully; however, any password in the password field that has a leading zero does not work.  For example, I have a list of over a hundred users with their date of birth mmddyyyy set as their password.  Any user that has a birthday in a month that has a leading zero (e.g., 01, 02, 03, etc... do not work with the set password); however, accounts without a leading zero (e.g., 10, 11, 12) work with the same password scheme without an issue (even those without leading zeros and zeros in other fields like year).  You can see the password with the leading zero in plain text .csv import file, so I do not think it is a file issue.  There are no trims, lefts, rights, or anything like that going on with the password field inside of the script.  This is a consistent pattern throughout hundreds of accounts.

For example .csv imported accounts that successfully import and allow successful login:


For example .csv imported accounts that successfully import, yet fail to login:


^All other information imports successfully and enabled, yet for some reason the passwords with leading zeros simply do not work...  I have tried several combinations with and without zeros to try to isolate the issue, and it seems like VBScript just cuts out that leading zero.

I do a wScript.echo sPassword and I can see that in the .vbs output the leading zero is missing, but I do not know exactly where this happens... perhaps:

sPassword = oRecordSet.Fields.Item(3).value

Is there any way I can preserve this leading zero?
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros