Prev | Current Page 591 | Next

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

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

The lines of dashes are used above and below the error message to make it easier to
distinguish an individual instance when multiple instances appear in sequence in the log.
The $total variable is used to keep a running total of the number of users processed. The $errorTotal
variable is used to keep a running total of the number of errors generated during the user creation
process.
# Set variables used to write to the log file
$err = $null
$blankLine = ???----------------------------------------------------------???
$total = 0
$errorTotal = 0
The next code segment handles the creation of mailbox - enabled user accounts using New-Mailbox in a
foreach loop. This is similar to that used for the same purpose in the first version of the script, but
incorporates error control and logging features as well as the addition of some important parameters.
The FirstName and LastName parameters are used to specify the first and last name attributes of the
new user accounts. The ErrorVariable parameter is used to specify a variable to which all errors
encountered by New-Mailbox are to be written. The $err variable is specified, but note that the $
character is not used when naming the variable.
The output from New-Mailbox normally goes to the console screen for display. Because logging is being
implemented, there is no need to see the default output.


Pages:
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
Gallery of Bialowieza Pozycjonowanie podgrzewacze wody Wyszukiwarka MP3 twojemiastopoznan.pl