Comments on: Powershell to get the number of mails in the Inbox and number of unread emails in Inbox/2009/08/24/powershell-to-get-the-number-of-mails-in-the-inbox-and-number-of-unread-emails-in-inbox/Microsoft Exchange & OWA Resources, Information - Optimize, Support, Manage | How-To | Guides | Reference | AdminFri, 19 Jul 2013 02:04:00 +0000hourly1http://wordpress.com/By: mckenzieaj/2009/08/24/powershell-to-get-the-number-of-mails-in-the-inbox-and-number-of-unread-emails-in-inbox/#comment-1733Fri, 19 Jul 2013 02:04:00 +0000/?p=639#comment-1733This modification works for situations where 1 is returned as the result:
$outlook = new-object -com Outlook.Application
$session = $outlook.Session
$session.Logon()
$inbox = $outlook.session.GetDefaultFolder(6)
[array]$unreadCount = @(%{$inbox.Items | where {$_.UnRead}}).Count
Write-Host $unreadCount
[array]$ItemCount = @(%{$inbox.Items }).Count
Write-Host $ItemCount

]]>
By: Danny Lo/2009/08/24/powershell-to-get-the-number-of-mails-in-the-inbox-and-number-of-unread-emails-in-inbox/#comment-376Fri, 04 Feb 2011 00:43:55 +0000/?p=639#comment-376Thanks for this shell command, I was wondering if you can help me alter this command so it checks every 30 minutes on an inbox for a user to see if there is an unread email older then 30 minutes and if so send an email alert? thanks in advance!
Reply

]]>
By: Danny Lo/2009/08/24/powershell-to-get-the-number-of-mails-in-the-inbox-and-number-of-unread-emails-in-inbox/#comment-375Fri, 04 Feb 2011 00:43:25 +0000/?p=639#comment-375Thanks for this shell command, I was wondering if you can help me alter this command so it checks every 30 minutes on an inbox for a user to see if there is an unread email older then 30 minutes and if so send an email alert? thanks in advance!

]]>