# Set up variables
$data = Import-CSV c:\import.csv
# Database where we are going to put the user mailboxes
$mdb = 'EX07SP1\Mailbox Database'
$ou = 'litwareinc.com/Users'
#Import the data and create the new mailboxes
ForEach ($i in $data){
$ss = ConvertTo-SecureString $i.password -asPlaintext -Force
$upn = $i.id + "@ehs.com"
New-Mailbox -Password $ss -Database $mdb -UserPrincipalName $upn -name
$i.fullname -OrganizationalUnit $ou -SamAccountName $i.id -FirstName
$i.firstname -LastName $i.lastname -Displayname $i.fullname
}
When I execute the acript I get the following error:
Cannot bind argument to parameter 'String' because it is null.
At :line:12 char:28
+ $ss = ConvertTo-SecureString <<<< $i.password -asPlaintext -Force
What I would like to do is when I import the users I would like the password
to be the users employee ID #(eight characters) and then they can change it
when they log in with Outlook Web Access. Below is data from the CSV file:
id,FullName,LastName,FirstName,Password
Madams,Mike Adams,Adams,Mike,84953436
Any ideas on how to make this work or what the error might be?
Thanks,
Alex
Marco
"al" <a...@discussions.microsoft.com> wrote in message
news:2FAC063F-9B4F-47C4...@microsoft.com...
id,FullName,LastName,FirstName,Password
Madams,Mike Adams,Adams,Mike,84953436
This is just one line that a tried to test. I am going to import 1700 users
into my AD/Exchange environment from and ldap extract that goes to a csv for
import. After I solve this password issue I have an another question.
Thanks,
Alex
"Marco Shaw [MVP]" wrote:
> .
>
Marco
"al" <a...@discussions.microsoft.com> wrote in message
news:3A5B1D76-9EEB-4728...@microsoft.com...
"Marco Shaw [MVP]" wrote:
> .
>
"al" <a...@discussions.microsoft.com> wrote in message
news:DB9AF426-8D39-4E1A...@microsoft.com...
Alex
"Marco Shaw [MVP]" wrote:
> .
>