If you work in an environment where new employees are frequently hired you might have a process in place
to provision your mailboxes and Mark.
Now you might like to generate reports or retrieve a list of mailboxes that were created you're in a
specific time frame or after a specific date.
And this video you'll learn a couple of ways to do this.
You know the Exchange management shell.
So let's start off with a simple example to generate a report of mailboxes created in the previous week
run the following command.
Get mailbox with results size parameter EKELUND to unlimited then pipe it to where object command and
foreach object when it when mailbox created property which will be greater than or equal to the date
when it will get the date was get date command and substract 7 days.
Then we'll pipe it to select Antrel select display name when mailbox created and database property.
And finally real expert this to say is for your file.
So this one liner searches through every mailbox in the organization by checking the when mailbox graded
property.
If the date is within the last seven days we select a few useful properties for Reach mailbox and expert
list to see us we file mailboxes are also have a property called when created.
So why don't we just check this property instead.
It's because the one created property is an active directory attribute that stores the creation date
of the user account and not the mailbox.
It is quite possible that your user records are created in Active Directory long before they are mail
enabled.
So using this property may not be reliable in your environment.
So we use when mailbox graded property instead when created property.
So when mailbox created property returns a date time object that can be compared to two other daytime
objects in the previous example we use the follow filter with a where object come and let one run in
the GET DATA command latter is out and parameters add date time object for the current date and time
is returned every day time object Groupwise and add days method that can be used to create a new date
time object.
So together the time object from seven days ago was simply pro-white a negative.
Well you're when calling this method and the result is a date and time from a week ago then we compare
the when mailbox created date to this well.
And if it is greater than or equal to seven days ago the command retrieves the mailbox you can use.
There are other daytime properties when performing the comparison.
For example let's say that the last month was October the 10th months of the year.
We can use the following command to retrieve all the mailboxes created in October in any past year.
This also gives us the ability to generate very customizable reports such as Ruport and only on mailboxes
that were created on Mondays in October.
And as you can see from this example there is a lot of flexibility here that you can use to customize
the output in order to meet your needs.
This is a good example of how we can externally Exchange management shell by tapping into the capabilities
of the Dot Net Framework.