Chat with us, powered by LiveChat

Blog

Back

New Reporting PowerShell cmdlets in Office 365 Preview

21 Jul 2012 by Emma Robinson

Microsoft recently released a Preview of the new version of it’s Office 365 Cloud platform. There are many interesting new features floating about in it including the new look Metro style interface, the name changes (P plans become Small Business and E plans become Enterprise) and some very juicy new Powershell cmdlets. The most interesting of these for us is the new suite of Office 365 Reports cmdlets. You can bet that you’ll be seeing the outputs of these appearing in our Office 365 Reports solution when this new Office 365 version moves into production.
Annoyingly, a lot of these are not working properly for me just yet. None the less, I will share with you what I have been able to get from them so far.

Get-MessageTrace

This cmdlet is pretty cool, it allows real message tracking right in Office 365!
Check out our script that reports on how many messages each user has sent and received per day.
You can track messages sent by a user between specific dates (Much like the current Delivery Report functionality)

PS C:\> Get-MessageTrace -SenderAddress alan@alantest3.onmicrosoft.com -StartDate 07/17/2012 -EndDate 07/21/2012 |fl
Message Trace ID : 7f2bce49-71ae-49d7-e91a-08cf32e4d8d2
Message ID :
Received : 18/07/2012 10:11:35
Sender Address : alan@alantest3.onmicrosoft.com
Recipient Address : frank@alantest3.onmicrosoft.com
From IP : #####
To IP :
Subject : Test Email
Status : Delivered
Size : 1600268
Message Trace ID : ebe7d6fd-6b6d-40c7-0605-08cf32e4e69d
Message ID :
Received : 18/07/2012 10:11:58
Sender Address : alan@alantest3.onmicrosoft.com
Recipient Address : mark@alantest3.onmicrosoft.com
From IP : #####
To IP :
Subject : Test Email
Status : Delivered
Size : 1600268
Message Trace ID : b47890d5-c4e4-4a61-aabc-08cf32e4f2ba
Message ID : <9ee0ac967cfb429dbe7b5d21432a7795@AMSPR06MB602.eurprd06.prod.outlook.com>
Received : 18/07/2012 10:12:18
Sender Address : alan@alantest3.onmicrosoft.com
Recipient Address : dan@alantest3.onmicrosoft.com
From IP : #####
To IP :
Subject : Test Email
Status : None
Size : 1598265

Or you can track all messages received by a certain address.

PS C:\> Get-MessageTrace -RecipientAddress alan@alantest3.onmicrosoft.com -StartDate 07/17/2012 -EndDate 07/19/2012 |fl
Message Trace ID : d64222ca-d4b6-424c-6780-08cf32e327f2
Message ID : <00000138998720e8-a3cab1e1-fc12-4d88-826b-f38d2790ed8c-000000@email.amazonses.com>
Received : 18/07/2012 09:59:30
Sender Address : reports@cogmotive.com
Recipient Address : alan@alantest3.onmicrosoft.com
From IP : #####
To IP :
Subject : Welcome to Cogmotive Reports
Status : None
Size : 40378
Message Trace ID : d9151373-6868-42dd-f74c-08cf32f0f2ac
Message ID : <84e110e7b9bc4c12bbeaeb3e38778428@DB3PR06MB619.eurprd06.prod.outlook.com>
Received : 18/07/2012 11:38:12
Sender Address : mark@alantest3.onmicrosoft.com
Recipient Address : alan@alantest3.onmicrosoft.com
From IP : #####
To IP :
Subject : Test Email
Status : None
Size : 1600250

Get-GroupActivityReport

This cmdlet returns the number of Distribution Groups created between specified dates. The Output looks like this:

PS C:\> Get-GroupActivityReport |fl
RunspaceId : cbafdd2d-4726-4fc1-a734-cca0274cfa7d
TenantGuid : 8358f174-66d4-4362-9cfa-e45433470fb4
TenantName : alantest3.onmicrosoft.com
Date : 19/07/2012 00:00:00
GroupCreated : 0
GroupDeleted : 0

It is worth noting that this report seems to be behind by several days. For example, I ran this command on the 22/07/2012 and the output is:

PS C:\> Get-GroupActivityReport
TenantName Date GroupCreated GroupDeleted
---------- ---- ------------ ------------
alantest3.onmicrosoft.com 20/07/2012 00:00:00 0 0
alantest3.onmicrosoft.com 19/07/2012 00:00:00 0 0

Get-MessageTraceDetail

This cmdlet didn’t seem to return anything, no matter what I threw at it.

Get-MailboxActivityReport

Shows you a count of the mailboxes created in your Exchange Online organisation between set dates.

Get-StaleMailboxReport

This cmdlet shows the number of mailboxes that have not been logged in to. This is a report we’ve had in Cogmotive Reports since day one. Good to see Microsoft thought it was important enough to include in the new version of Office 365.

PS C:\> Get-StaleMailboxReport | fl
RunspaceId : 73002f88-6768-48a4-bd80-ba9d0be394d5
TenantGuid : 8358f174-66d4-4362-9cfa-e45433470fb4
TenantName : alantest3.onmicrosoft.com
Date : 19/07/2012 00:00:00
ActiveMailboxes : 2
InactiveMailboxes : 4
InactiveMailboxes31To60Days : 0
InactiveMailboxes61To90Days : 0
InactiveMailboxes91To1460Days : 0

Get-StaleMailboxDetailReport

This is supposed to return the names of the mailboxes that haven’t been access for 30 days. All I could get it to do was this…

PS C:\> Get-StaleMailboxDetailReport
WARNING: The report is not available in the data mart.

Get-RecipientStatisticsReport

This reports a count of the various types of recipients in your Exchange Online tenant.

PS C:\> Get-RecipientStatisticsReport |fl
RunspaceId : cbafdd2d-4726-4fc1-a734-cca0274cfa7d
Identity : EURPR06A001.prod.outlook.com/Microsoft Exchange
Hosted Organizations/alantest3.onmicrosoft.com
TotalNumberOfMailboxes : 6
TotalNumberOfActiveMailboxes : 2
NumberOfContacts : 0
NumberOfDistributionLists : 11
LastUpdated : 21/07/2012 00:00:00
LastUpdatedFormatted : 21/07/2012
IsValid : True
ObjectState : New

There are many more of these types of cmdlets, but I have not been able to get them to return anything meaningful to date.

I will definitely be writing a followup to this post once I can find out more information.