![]() ![]()
Windows PowerShell automatically casts the string to a date for me, and I am at little risk of messing up my script. For example, if I only want to see a mailbox report for a date that is later than 6/30/14, I can add the following to my script: But to be honest, it is easier for me to use Windows PowerShell to do this. It is possible to use a filter, an orderby in the query string, or the Select option. TotalInactiveMailboxCount = $_.TotalInactiveMailboxCount } } ![]() MailboxesOverWarningSize = $_.MailboxesOverWarningSize This script uses Windows PowerShell 3.0 syntax to create a custom object that contains the properties I specified earlier: I want the complete DateTime object because it has a number of methods that make it easier to work with. I decided that, unlike yesterday, I do not want a string for a date. Now I need to create a custom object for my output. (Invoke-RestMethod -Credential $cred -uri $url).d.results | Grouping returns the results and sends them down the pipeline. The Invoke-RestMethod cmdlet accepts the credentials from the XML file and the URI created in the previous string. The next portion uses a string to create the report URL: $aryP = "Date,TenantName,MailboxesOverWarningSize,TotalInactiveMailboxCount,TotalMailboxCount" I then used an expanding string to create the Select portion of the query string. In the end, I decided that I did not need all of the properties. I decided to create a separate variable to hold the property names because the property names are all pretty long, and my script was getting bulky. $cred = Import-Clixml C:\fso\ScriptingGu圜redential.xml MICROSOFT AUTOROUTE EXPRESS EUROPE 98 DOWNLOAD CODEThis portion of the code reads the credentials from the XML file and specifies the URL root, the format, and the report to run: The first portion of the script is the same as the one used yesterday. Note Todays script is based on the one I created yesterday, and you should read that post for more details about the script and how it works: Use PowerShell for Office 365 Reporting. Information about the report is available on the MSDN page that details this report: MailboxUsage report. The report makes the following fields available: The MailboxUsage report REST URI provides summary stats about the Office 365 organization's mailbox usage. Not here yet, but then it isn’t even 8:00 AM yet either. ![]() So, I am looking for her phone to show up in the morning deliveries. In the end, it was the camera that tipped the scale. She came close to ordering the Nokia 1520 due to the 41-megapixel camera and because of the larger screen. She ended up ordering the Nokia Lumia 1020. She is turning out to be a huge gadget geek, and she announced that she simply must have a new phone. To be fair, it will be her birthday present, although she may not know that yet. I am looking for the Scripting Wife’s phone. I am using my Windows Surface Pro 2 to check my email, and to make sure the Hey, Scripting Guy! Blog posted properly overnight. This morning I am sipping a cup of pomegranate black tea, and nibbling on a fresh blueberry scone. Microsoft Scripting Guy, Ed Wilson, is here. Summary : Use Windows PowerShell to produce a mailbox activity report for Office 365. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |