Powershell using Outlook.Application to pull out the mailbox details
$outlook = new-object -com Outlook.Application
$session = $outlook.Session
$session.Logon()
$inbox = $outlook.session.GetDefaultFolder(6)
$unreadCount = (%{$inbox.Items | where {$_.UnRead}}).Count
Write-Host $unreadCount
$ItemCount = (%{$inbox.Items }).Count
Write-Host $ItemCount