Powershell help needed - password not being set
Hi. I have no doubt done something stupid, but if anyone could be so kind as to point out exactly what... I am trying to create new users and mailboxes from a csv file. Users and mailboxes are created and they are enabled. There are no error messages. However when I try to login as one of them through OWA I get "username or password incorrect". If I manually reset the password to what I expected it to be, I can then login. Here's my script: cat add_users.csv > add_users2.csv # make utf8 import-csv add_users2.csv | foreach { $secureString = ConvertTo-SecureString -string $_.password -AsPlainText Force New-Mailbox -Name $_.displayName -displayName $_.displayName -Alias $_.alias -OrganizationalUnit$_.OU -UserPrincipalName $_.UPN -SamAccountName $_.UID -FirstName $_.givenName -Initials '' -LastName $_.surname -Database$_.MDB -password $secureString -ResetPasswordOnNextLogon $true } | out-file -filepath "c:\scripts\add_users.txt" -encoding "UNICODE" TIA, Carol
September 8th, 2008 5:36pm

Carol, Try this as the $secureString $secureString = ConvertTo-SecureString $_.password -asPlainText -force Regards, Johan visit my site: www.johanveldhuis.nl
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2008 9:03pm

Actually I had already tried that - I only added the "-string" after reading through the get-help. The password is not set either way. Carol
September 9th, 2008 9:41am

I've solved it myself. It was because of the -ResetPasswordOnNextLogon $true. If I set it to -ResetPasswordOnNextLogon $false then the accounts can be used. How incredibly stupid. Surely the user should be able to login the first time? I guess I will have to force the password change later. Carol
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2008 10:00am

I have solved it myself. It was because of the -ResetPasswordOnNextLogon $true. Apparently I have to have -ResetPasswordOnNextLogon $false. I was under the impression that OWA was capable of prompting a user to change their password. Guess not. Carol
September 9th, 2008 10:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics