WEBVTT

00:06.230 --> 00:13.430
If you work in an environment where new employees are frequently hired you might have a process in place

00:13.430 --> 00:16.690
to provision your mailboxes and Mark.

00:16.700 --> 00:24.230
Now you might like to generate reports or retrieve a list of mailboxes that were created you're in a

00:24.470 --> 00:28.850
specific time frame or after a specific date.

00:29.000 --> 00:32.450
And this video you'll learn a couple of ways to do this.

00:32.450 --> 00:35.060
You know the Exchange management shell.

00:35.120 --> 00:43.430
So let's start off with a simple example to generate a report of mailboxes created in the previous week

00:43.760 --> 00:45.510
run the following command.

00:45.650 --> 00:56.060
Get mailbox with results size parameter EKELUND to unlimited then pipe it to where object command and

00:56.300 --> 01:05.990
foreach object when it when mailbox created property which will be greater than or equal to the date

01:06.020 --> 01:12.660
when it will get the date was get date command and substract 7 days.

01:12.710 --> 01:22.050
Then we'll pipe it to select Antrel select display name when mailbox created and database property.

01:22.190 --> 01:26.470
And finally real expert this to say is for your file.

01:26.480 --> 01:34.550
So this one liner searches through every mailbox in the organization by checking the when mailbox graded

01:34.550 --> 01:35.470
property.

01:35.660 --> 01:45.170
If the date is within the last seven days we select a few useful properties for Reach mailbox and expert

01:45.170 --> 01:53.780
list to see us we file mailboxes are also have a property called when created.

01:53.780 --> 01:57.710
So why don't we just check this property instead.

01:57.860 --> 02:06.440
It's because the one created property is an active directory attribute that stores the creation date

02:06.440 --> 02:09.880
of the user account and not the mailbox.

02:09.890 --> 02:18.230
It is quite possible that your user records are created in Active Directory long before they are mail

02:18.230 --> 02:19.060
enabled.

02:19.160 --> 02:24.010
So using this property may not be reliable in your environment.

02:24.140 --> 02:30.870
So we use when mailbox graded property instead when created property.

02:31.010 --> 02:40.940
So when mailbox created property returns a date time object that can be compared to two other daytime

02:41.240 --> 02:48.740
objects in the previous example we use the follow filter with a where object come and let one run in

02:48.740 --> 02:56.420
the GET DATA command latter is out and parameters add date time object for the current date and time

02:56.420 --> 03:05.610
is returned every day time object Groupwise and add days method that can be used to create a new date

03:05.600 --> 03:06.980
time object.

03:06.980 --> 03:13.830
So together the time object from seven days ago was simply pro-white a negative.

03:13.840 --> 03:22.280
Well you're when calling this method and the result is a date and time from a week ago then we compare

03:22.280 --> 03:26.430
the when mailbox created date to this well.

03:26.510 --> 03:36.200
And if it is greater than or equal to seven days ago the command retrieves the mailbox you can use.

03:36.230 --> 03:40.960
There are other daytime properties when performing the comparison.

03:40.970 --> 03:48.290
For example let's say that the last month was October the 10th months of the year.

03:48.290 --> 03:56.680
We can use the following command to retrieve all the mailboxes created in October in any past year.

03:56.810 --> 04:05.360
This also gives us the ability to generate very customizable reports such as Ruport and only on mailboxes

04:05.630 --> 04:09.800
that were created on Mondays in October.

04:09.950 --> 04:17.270
And as you can see from this example there is a lot of flexibility here that you can use to customize

04:17.270 --> 04:20.720
the output in order to meet your needs.

04:20.720 --> 04:28.370
This is a good example of how we can externally Exchange management shell by tapping into the capabilities

04:28.430 --> 04:30.550
of the Dot Net Framework.
