Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

a script to change user's properties

  • Filter
  • Time
  • Show
Clear All
new posts

  • a script to change user's properties

    I want to set user passwords and enable them with a script.
    User names and their new passwords are stored in a csv file.
    I know that I can use DSmod, but I don't know how to write the script.
    also DSmod command needs the DN of users, how can I find that?

  • #2
    Re: a script to change user's properties

    you can use DSGET to get the DN details.
    dsmod/dsget etc isn't immensely hard to use - just spend some time looking at the help pages, and see if maye you can find some other scripts around the place that do similar to what you want, and them cobble them together.
    Please do show your appreciation to those who assist you by leaving Rep Point


    • #3
      Re: a script to change user's properties

      I found the solution :
      This is a script for enable and change the user's passwords in the "MyDomain.local":
      Username and passwords are stored in teh "users.csv" file.

      import-csv c:\users.csv | foreach {Dsmod user ("CN="+$_.userName+",OU=MyOrganizationUnit, DC=MyDomain, DC=local") -pwd $_.Password -pwdneverexpires yes -disabled No}