ps1 is that it can be used as a maintenance task.
Because the script validates the need to create a public folder for the given user, if the script is presented
a group of mailbox - enabled users for processing, it is able to create folders as needed while ignoring
users that already have folders.
To accomplish this, Get-Mailbox can be used to gather a collection of mailbox - enabled users based on
some common property, then pass this collection by pipeline to a foreach command that calls the script
for each user in the collection in turn.
Part IV: Automating Administration
464
For example, the following command gathers all the mailbox - enabled user accounts in the
Organizational Unit ??? team , ??? and then passes them to the foreach block for execution:
Get-Mailbox -OrganizationalUnit exchangeexchange.local/team | foreach {newuserpublicfolder.
ps1 $_} > c:\results.txt
The results of each cycle of the script in the foreach command are normally displayed at the command
line, which may be awkward to follow when there are a large number of users to process. To address
this, the command uses a redirection to a text file that can be reviewed for errors by the administrator
once the command completes.
Summary
Administrators know scripts automate everyday tasks and ensure consistent results.
Pages:
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646