To accomplish this, first you create a template
user for the Engineering department using the New-Mailbox cmdlet, and next you use the
Set-Mailbox cmdlet to customize the user settings as desired. Your next step is to assign a variable to
the template user created. These steps are shown in Figure 4 - 35 .
Figure 4-35
Now that you ??™ ve created your template, you return back to your CSV file. This time it ??™ s another set of
new hires into various departments provided in the NewHire1.csv file shown in Figure 4 - 36 . You need
to filter the CSV file to show just the users from the Engineering department. You can do that using
either the Filter parameter or the Where-object cmdlets; here we used the latter:
[PS] C:\ > Import-Csv newhire1.csv | where {$_.department -eq ???Engineering??™}
Part I: PowerShell for Exchange Fundamentals
134
You can assign this to a variable called $Engineering :
[PS] C:\ > $Engineering = Import-Csv newhire1.csv | where {$_.department -eq
???Engineering??™}
Now you can create the users based on the $TemplateEngineering template using the
TemplateInstance parameter. These steps are shown in Figure 4 - 37 .
The users created based on the Engineering template all have the same value for the attributes shown.
Another way to bulk create mailboxes is to specify how many mailboxes to create using dotted notation
and use the ForEach looping expression as an input into the New-Mailbox cmdlet.
Pages:
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231