cawasaki
asked on
powershells cript to modify password for AD users from csv file
hello,
i have windows 2008 r2 domain controller
i need a powershell script to modify an AD user password from csv file.
the csv are in this form:
user1,password
user2,password
....
where user1 is a samacountname.
if possible i need a log file to see if it sucess like this:
user1, password changed
user2,password changed
user3, password not changed (for exemple if not respect password policy)
thanks for help
i have windows 2008 r2 domain controller
i need a powershell script to modify an AD user password from csv file.
the csv are in this form:
user1,password
user2,password
....
where user1 is a samacountname.
if possible i need a log file to see if it sucess like this:
user1, password changed
user2,password changed
user3, password not changed (for exemple if not respect password policy)
thanks for help
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@spec01
the file must be in this form: ???
sAMAccountName,Password
jdoe,password
steph,password
....
???
and for log file?
the file must be in this form: ???
sAMAccountName,Password
jdoe,password
steph,password
....
???
and for log file?
The sAMAccountName and Password are headings in the CSV file (column A would be sAMAccountName comlum B would be Password). There are no "," between the headings, they are heading for different columns. You then put the respective names/passwords under each heading.
As for the logging, if the password change fails you will get an error stating the name where it failed in the powershell window.
Will.
As for the logging, if the password change fails you will get an error stating the name where it failed in the powershell window.
Will.
ASKER
hi,
sorry i dont understand, in the csv file you put many space:
sAMAccountName Password
jdoe P@ssword
etc...
may be it an excel file?
sorry i dont understand, in the csv file you put many space:
sAMAccountName Password
jdoe P@ssword
etc...
may be it an excel file?
You may create the file in excel, the the two columns specified. Simply save as type CSV
I put spaces in my post on here to illustrate the sepration between the columns. In Excel (saved as a CSV file) you have columns A B C D etc. Use the first 2 columns A and B and put in your headings as i have described above. Continue this pattern for the actual users and passwords under there respective headings.
Will.
Will.
ASKER
Ok i will test.
Its possible to get a log file because if i lunsh the script for 100 account i cannot see all pn screen :)
Thanks for help
Its possible to get a log file because if i lunsh the script for 100 account i cannot see all pn screen :)
Thanks for help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not sure about the script mentioned by you, but for more result please have a look at these links , best for the same query in terms of scripts.
http://www.flexecom.com/import-users-from-a-csv-file-into-active-directory-using-powershell/
http://gallery.technet.microsoft.com/scriptcenter/Reset-password-for-all-412fbc72
http://community.office365.com/en-us/forums/158/p/52805/186481.aspx
Thanks.
http://www.flexecom.com/import-users-from-a-csv-file-into-active-directory-using-powershell/
http://gallery.technet.microsoft.com/scriptcenter/Reset-password-for-all-412fbc72
http://community.office365.com/en-us/forums/158/p/52805/186481.aspx
Thanks.
ASKER
hello,
so i have an excel file, i put a column to samaccountname and one for password, after that i need to save file to csv, but i have many csn file option like csv dos, csv macintosh...
wish one i choose?
thanks
so i have an excel file, i put a column to samaccountname and one for password, after that i need to save file to csv, but i have many csn file option like csv dos, csv macintosh...
wish one i choose?
thanks
Probably doesn't make a difference, but I wouldn't choose the Mac one. Either ".CSV (Comma delimited)" or ".CSV (MS-DOS)" should work for you.
ASKER
thank you
Open in new window