Posts

Showing posts with the label Report

Reporting Progress with Powershell

Image
Often in the life of an IT engineer or administrator, the command shell is a means of performing an operation on multiple items that would otherwise take a significant amount of time if performed via GUI tools.  When planning for such operations, reporting on progress is a nice thing to have, since it may take a while for the entire operation to complete and we need to know if things are working out as expected. In the majority of the cases, we know the actions that need to be taken in advance and thus the easiest way to go through them is to use a For loop. With For we start processing the items in an array or list either from its start or end and work our way to the last item by incrementing, usually by one. The Powershell code below will get the items in the current directory and sequentially process them, reporting the status of the operation after each item: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Get the list of items to process $items = @ ( Get-ChildItem ) # Loop...

Get Exchange Mailbox Quota Status using PowerShell

Back in the old days of Microsoft Exchange, when quota was applied to a mailbox we had a way to check the status of the quota using the "Get-MailboxStatistics" cmdlet and the property "StorageLimitStatus". On the newer versions of Exchange, this property does not contain a value since it has an impact on the performance against Active Directory (read more here ). In order to overcome this issue - and since I'm often checking for the quota status - I've decided to create a PowerShell function. The function is called "Get-MailboxQuotaStatus" and it's available with my Exchange module since version 2.4.1 . What it actually does is to check if the mailbox follows the database quotas or it's own and then compare the quota values against the size of the mailbox. The objects that this function returns are consisted of the mailbox object that is returned from the "Get-Mailbox" cmdlet and the status of the quota. The possible values...