IT tutorials
 
Technology
 

Using the Windows PowerShell in an Exchange Server 2007 Environment : Using EMS to Do Reporting (part 1) - Generating Largest Mail User Reports

12/20/2013 1:01:51 AM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
EMS has built-in reporting features that use a variety of outputs. For example, the following cmdlet verifies server functionality by logging on to the specified user’s mailbox and reporting the latency:
Test-MapiConnectivity [email protected]

The output is presented on the display similar to the one shown in Figure 1.

Figure 1. Output generated by EMS reporting.

Output is normally sent to the display, but it can also be sent to files using redirection. EMS has special cmdlets that also produce comma-separated values (CSV), Extensible Markup Language (XML), and HTML output. These types of output provide the flexibility that administrators need to manipulate the data using familiar tools, such as Microsoft Excel.

1. Generating Largest Mail User Reports

The following example uses PowerShell to list the top 25 largest mailboxes on the specified server, the total number of mail items, and the size of the mailbox. It sorts the list by descending size. The example uses the standard Exchange WMI provider to access this information.

Get-wmiobject -class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2 
-ComputerName SERVER1 | select-object MailboxDisplayName,TotalItems,Size
 | sort -descending "Size" | select-object -first 25



This data might be useful for administrators to know who might need data retention training. It might also be useful to demonstrate the need for email archiving.

To make this script more portable, the output can be converted to HTML and redirected to a file, like this:

Get-wmiobject -class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2
 -ComputerName SERVER1 | select-object MailboxDisplayName,TotalItems,Size
| sort -descending "Size" | select-object -first 25 | ConvertTo-html
-title "Top 25 Largest Mailboxes on SERVER1" > "D:\Stats\25 Largest Mailboxes.html"



Improving it further, the output could be redirected to a unique filename, based on the system date:

Get-wmiobject -class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2
 -ComputerName SERVER1 | select-object MailboxDisplayName,TotalItems,Size
 | sort -descending "Size" | select-object -first 25 | ConvertTo-html
-title "Top 25 Largest Mailboxes on SERVER1" > ("D:\Stats" + (get-Date).ToString("yyyyMMdd") + ".html")



Now, the cmdlet can be scheduled to run once per day, maintaining a separate report for each day.

Save the cmdlet in a .ps1 file as Top25LargestMailboxes.ps1. Because .ps1 files cannot be run directly from the Cmd.exe prompt or by the Windows Task Scheduler, the administrator must run it within the EMS/PowerShell environment. This is accomplished by using the command PowerShell Top25LargestMailboxes.ps1. An alternative is to create a batch file containing the same command and run the batch file. The batch file can then be scheduled to run once per day.

Tip

The Top 25 Largest Mailboxes report could be published to the company’s SharePoint “Wall of Shame.” Users will take measures to not make the list.

 
Others
 
- LINQ to SharePoint and SPMetal : Updating Information Using LINQ to SharePoint (part 3) - Resolving Change Conflicts
- LINQ to SharePoint and SPMetal : Updating Information Using LINQ to SharePoint (part 2) - Handling Concurrency Errors when Updating Data
- LINQ to SharePoint and SPMetal : Updating Information Using LINQ to SharePoint (part 1) - Disconnecting Entities , Reconnecting Entities
- Windows Vista : Running BitLocker Full Drive Encryption (part 2) - Relying on Group Policy to manage BitLocker
- Windows Vista : Running BitLocker Full Drive Encryption (part 1) - Understanding BitLocker requirements
- Windows Vista : Using the Encrypting File System (part 4) - Working with EFS - Implementing an EFS recovery solution
- Windows Vista : Using the Encrypting File System (part 3) - Working with EFS - Implementing EFS
- Windows Vista : Using the Encrypting File System (part 2) - Working with EFS - Identifying potential EFS uses, Preparing the PKI for EFS
- Windows Vista : Using the Encrypting File System (part 1) - Understanding EFS, Interacting with EFS and PKI
- Installing Microsoft SQL Server 2008 R2 Standard Edition for Small Business (part 4)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us