You can retrieve all kinds of information about the mailbox database using the change management style.
Come on let's.
Surprisingly the total number of mailboxes in a given mailbox database is not one of those pieces of
information we need to retrieve this data manually.
Luckily power shell makes this easy as you will see in this video.
There are two ways that you can retrieve the total number of mailboxes in a database.
First we can use the current property of a collection of mailboxes.
You can type the following command.
Get a mailbox database.
D.B 20 in parenthesis that count.
Another way to retrieve this information is to use the Mazzer object come on flat using the same collection
from the receipt.
An example will type gurt mailbox database debit renter and pipe it to measure object.
Come on land in both stirps we use the get mailbox come on and specify the database parameter retrieval
to retrieve all the mailboxes in that particular database in the first example.
We have wrapped the amount inside the braces characters to ensure that power shell will always interpret
the output as an array.
The reason for this is that if the mailbox database contains only one mailbox the resulting output object
will not be a collection and also will not be the current property.
Remember the default result size for get mailboxes 1000 set.
The result size parameter to a limit.
To override this the second step makes use of the Master object command let.
You can see that in addition to the Count property we also get a number of other details.
Consider the output as shown on my screen to retrieve only the total number of mailboxes.
We can extend this command further in two ways.
First we can enclose the entire command in parenthesis and to access the current property like in this
example.
In parenthesis we have got mailbox does database DBI Atlanta piped to measure object come and loud and
we use called property.
In this case the command would return only the total number of mailboxes in DBI Trantor database.
We can also pipe the command to select object and to use the expand property parameter to retrieve only
the value of the current property like in this example.
Get my a box database measure object and select object with expand property parameter.
This command to it again only returns the total number of mailboxes in the database.
One of the most common questions that comes up when people see both of these matters is of course which
way is faster.
Well we can use the measure command command to determine this information but the truth is that your
results are all very greatly and there probably won't be a huge difference in this case.
The syntax to measure the time it takes to return a script or command is shown.
Next we can type Mazzard command expec expression and they come out to itself.
Simpler suppliers group block containing the commands you want to measure and assign it to the expression
parameter as shown previously.
The measure command command will return a time span object that reports on the total miles seconds seconds
and minutes that it took to complete the command.
You can then compare this ralliers to other comments that produce the same result but to use alternative
syntax or C'mon let's please note that to report all the total number of archive mailboxes use get mailbox
dust filter Antium curly braces archive name not equal to now and then pipe it to Mazzer object.
Now we can easily determine the total number of mailboxes in each database using a single command.
The key to this is using the select object command to create a calculated group or two.
For example get mailbox database by select object by name and calculated property and research we want
I call on Toto mailboxes and expression for that real bad get mail mailbox for each item taken from
the pipeline and it should be counted.
This command will generate output similar to mine.
It pipes the output from get mailbox database to the select object command left and for each database
out put by the command we select the database name and then use their beers item object when creating
the calculated Ruperta to determine the total number of mailboxes using the Get mailbox command and.
This command can be piped thother down to the out file or expert says Feachem and let's that real generator
abort safety in an external file as we've already done lots of times previously in previous lessons.