+ Post New Thread
Results 1 to 3 of 3
Windows Server 2008 Thread, (Bulk) Change user passwords using csv in Technical; Hi gang, I need to change all the staff and student passwords using a csv file I created last night. ...
  1. #1
    PEO
    PEO is online now
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72

    (Bulk) Change user passwords using csv

    Hi gang,

    I need to change all the staff and student passwords using a csv file I created last night.

    I need a script that will basically look at coloum1 for the username to search for that username and then use coloum 2 to change the users password.

    here is a script I found. Does this look like it will do the job?

    Code:
    foreach($user in (import-Csv C:\UPass.csv))
    {
        Write-Host "Setting Password for $($User.username)"
        $ds = new-Object System.DirectoryServices.DirectorySearcher([ADSI]"","(&(objectcategory=user)(sAMAccountName=$($user.username)))")
        $usr = ($ds.Findone()).GetDirectoryEntry()
        $usr.SetPassword($user.password)
        $usr.SetInfo()
    }
    cheers

  2. #2
    PEO
    PEO is online now
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    bump

  3. #3
    PEO
    PEO is online now
    PEO's Avatar
    Join Date
    Oct 2007
    Posts
    2,096
    Thank Post
    457
    Thanked 152 Times in 96 Posts
    Rep Power
    72
    Ok, dosent matter I've figured it out and updated my lists.

SHARE:
+ Post New Thread

Similar Threads

  1. Bulk Change User Setting
    By bmdixon in forum Windows
    Replies: 13
    Last Post: 11th February 2009, 11:07 AM
  2. Replies: 12
    Last Post: 29th September 2008, 10:57 AM
  3. Replies: 6
    Last Post: 29th February 2008, 12:03 AM
  4. Bulk Change Local Administrator Passwords.
    By Nij.UK in forum Windows
    Replies: 14
    Last Post: 15th June 2007, 01:45 PM
  5. Allowing staff to change kids passwords
    By Simcfc73 in forum How do you do....it?
    Replies: 28
    Last Post: 21st August 2006, 07:55 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •