blog.icewolf.ch

Let's talk about IT!
posts - 590, comments - 86, trackbacks - 0

Mailbox Provisioning from CSV File

Hallo zusammen,

Heute zeige ich euch mal, wie man User und Mailboxen aus einem CSV File anlegt.

Als erstes machen wir ein CSV (Comma Separated Value) File und speichern es unter C:\mitarbeiter.csv ab

Name,FirstName,LastName,UPN,OU
Albert Einstein,Albert,Einstein,a.einstein@foo.com,TestOU
Niels Bohr,Niels,Bohr,n.bohr@foo.com,TestOU

So sieht das Script aus:

$Pwd = ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force
$csv = Import-Csv c:\mitarbeiter.csv
$csv | ForEach-Object{New-Mailbox -Name $_."Name" -FirstName $_."FirstName" -Lastname $_."LastName" -UserPrincipalName $_."UPN" -OrganizationalUnit $_."OU" -Password $Pwd}

Und nun lassen wir das ganze mal laufen...

GrĂ¼sse
Andres Bohren

Print | posted on Monday, May 10, 2010 11:10 PM | Filed Under [ Exchange Powershell ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 7 and 2 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET