Prev | Current Page 577 | Next

Joezer Cookey-Gam, Brendan Keane, Jeffrey Rosen, and Jonathan Runyon

"Professional Windows PowerShell for Exchange Server 2007 Service Pack 1"

Please ma
ke sure you have typed it correctly.
At C:\Program Files\Microsoft\Exchange Server\Scripts\simplebulk-newmailbox.ps1
:17 char:9
+ N < < < < ew-Mailbox -Name:$user.name -Database:$user.Database -Organiza
tionalUnit:$user.OrganizationalUnit -UserPrincipalName:$user.UserPrincipalName
-FirstName:$user.FirstName -LastName:$user.LastName -Password:$password -ResetP
asswordOnNextLogon:$true
User Seven user7 mb001 unlimited
User Eight user8 mb001 unlimited
As you can see in the first line of output, User One has been created without issue as indicated by
the default output from New-Mailbox . However, creation of the next user has failed as per the error
message shown. In this case the error indicates the OrganizationalUnit property value passed to
New-Mailbox did not exist in Active Directory. Creation of another user failed in a similar fashion
because the Database property value specified does not exist.
The way these errors appear in the default output demonstrates one of the biggest weaknesses of this
simple version of a user creation script: error handling. You can probably recognize from this output that
User Two and User Six have failed creation by the position of the error messages among the other
lines of output.
Now imagine that a CSV file contains hundreds of entries, with real names instead of sequentially
numbered test accounts.


Pages:
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
jak rysowa Ustawy Nr1 sherwood mmorpg ochrona Magma