A user inquired about creating a trigger for Outlook Inbox on a server, and received a response suggesting the use of ControlUp to run a script using PowerShell and the Outlook COM Object. The script would then check and report the number of items in the Inbox. An example code was also provided. This solution was provided by Yoni and can be implemented through ControlUp.
Read the entire ‘Creating Triggers in ControlUp for Outlook Inbox Monitoring’ thread below:
Good morning – I would like to create a trigger that alerts us if an Inbox in Outlook on a server is not empty. Is there a way to do so? Thank you.
I guess you can use ControlUp (RTDX or Edge DX) to run a script when the user logs on. The script can use PowerShell with Outlook COM Object to check this and report back via email / Teams / Slack / whatever…
here is a code example courtesy of ChatGPT:
“`# Create Outlook Application object
$outlook = New-Object -ComObject Outlook.Application
Get the Inbox folder
$namespace = $outlook.GetNamespace("MAPI")
$inbox = $namespace.GetDefaultFolder(6) # 6 refers to the Inbox folder
Check the items in Inbox
if ($inbox.Items.Count -eq 0) {
Write-Host "Inbox is empty."
} else {
Write-Host "Inbox has $($inbox.Items.Count) items."
}“`
Awesome, thanks Yoni!
Continue reading and comment on the thread ‘Creating Triggers in ControlUp for Outlook Inbox Monitoring’. Not a member? Join Here!
Categories: All Archives, ControlUp Edge DX, ControlUp Scripts & Triggers