Solved

Create Random .CSV data

Posted on 2009-07-16
5
342 Views
Last Modified: 2013-11-15
Hi Experts,

I have a strange request. I am building a test Exchange 2007 environment and I want to manage large numbers of accounts. Does anyone know of any template .CSV files I can download that contain user names and email addresses that I can import into Exchange?
I would like to have hundreds or even thousands of accounts. Otherwise is there a way to generate this data through Excel or via scripts?

Thanks in advance
0
Comment
Question by:nealerocks
  • 4
5 Comments
 
LVL 27

Accepted Solution

by:
shauncroucher earned 500 total points
ID: 24872887
Hi,

I have a CSV I created whilst testing bulk management using powershell.

Attached is the CSV. Put this in same directory where you run the following command and it will create a whole load of unique users (250 for this CSV) and puts them in the Mailbox Database called 'Mailbox Database' (change this if yours is different). Organisational Unit Users (change if you prefer somewhere else).  

I used Excel to create the CSV.

Import-Csv recipients.csv | foreach { $Password = ConvertTo-SecureString $_.password -asplaintext -force;$UPN = $_.UPN+$_.Domain; New-Mailbox alias $_.Alias name $_.Name -FirstName $_.FirstName -LastName $_.LastName UserPrincipalName $UPN Database mailbox database OrganizationalUnit Users Password $Password}


recipients.csv
0
 
LVL 27

Expert Comment

by:shauncroucher
ID: 24872908
Posting that changed hyphen to !!
I'll try that again.

Command:

Import-Csv recipients.csv | foreach { $Password = ConvertTo-SecureString $_.password -asplaintext -force;$UPN = $_.UPN+$_.Domain; New-Mailbox alias $_.Alias name $_.Name -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $UPN Database mailbox database -OrganizationalUnit Users -Password $Password}

0
 
LVL 27

Expert Comment

by:shauncroucher
ID: 24872924
I don't know why hyphens are being turned into double exclamation marks here. Sorry.

One more go:

Import-Csv recipients.csv | foreach { $Password = ConvertTo-SecureString $_.password -asplaintext -force;$UPN = $_.UPN+$_.Domain; New-Mailbox -alias $_.Alias -name $_.Name -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $UPN -Database mailbox database -OrganizationalUnit Users -Password $Password}

0
 
LVL 27

Expert Comment

by:shauncroucher
ID: 24872946
Right, I haven't attached code on here before except simple Powershell commands.

This is the full command you need with the CSV. Ignore all others.

Shaun
Import-Csv recipients.csv | foreach { $Password = ConvertTo-SecureString $_.password -asplaintext -force;$UPN = $_.UPN+$_.Domain; New-Mailbox -alias $_.Alias -name $_.Name -FirstName $_.FirstName -LastName $_.LastName -UserPrincipalName $UPN -Database "mailbox database" -OrganizationalUnit Users -Password $Password}

Open in new window

0
 
LVL 12

Author Closing Comment

by:nealerocks
ID: 31604351
Thats awesome thanks!!!
0

Featured Post

Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now