On Apr 30, 2013, at 10:48 AM, Robin Wood wrote:

> I'm setting up a lab for some training I've got and I need to set up a
> bunch of users on my 2008 DC. I know there are scripts to do this but can't
> find any, has anyone got a good one?
> 


I wrote this powershell to mass change passwords, set-aduser should change to 
new-aduser pretty directly.  logins.txt is just a username,password CSV file 
(with username,password as the header)

$inputfile = ".\logins.txt"

$data = import-csv $inputfile

foreach ($user in $data) {
        $pass = ConvertTo-SecureString $user.password -AsPlainText –Force
        $user = $user.username
        write-host creating $user
        set-aduser -identity $user -AccountPassword $pass -CannotChangePassword 
$true -PasswordNeverExpires $true
}


-barry
_______________________________________________
Pauldotcom mailing list
[email protected]
http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom
Main Web Site: http://pauldotcom.com

Reply via email to