E=mc2
asked on
Simple script to see any new emails in Office365
Is there a Powershell or VBS or batch script that can be run which will show you quickly similar to an inbox, for Office365 emails, perhaps specifycing
simply any new emails received in an Inbox with From, Subject and Time.. like a quick view?
I wanted to be able to run a script from a menu, perhaps called 1.Email, and then quickly log into Office365 email to see if any new emails have come in etc.. without having to open Outlook or any other major email client..
simply any new emails received in an Inbox with From, Subject and Time.. like a quick view?
I wanted to be able to run a script from a menu, perhaps called 1.Email, and then quickly log into Office365 email to see if any new emails have come in etc.. without having to open Outlook or any other major email client..
Yes, you can. You use EWS (Exchange Web Services)
After connecting
After connecting
# Get the Mailbox ID of the Inbox folder.
$inboxFolderID = [Microsoft.Exchange.WebServices.Data.FolderId]::new([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailAddress)
# Bind to the inbox folder.
$boundFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($objExchange,$inboxFolderID)
$boundFolder.UnreadCount
https://stackoverflow.com/questions/44160461/checking-number-of-unread-exchange-mails-with-ews
ASKER
Thanks Shaun. And what would be the script to connect then? Or what is before this??
It is the first part on that link, the section in OP's question
ASKER
Thanks again Shaun. Ok, I added credentials etc., however now I don't know where to replace the script you provided or what to remove in order to make it work?
ASKER
This does not work, I found another solution online.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't bother trying to reinvent the wheel, it'll be longer for you to run the script than it would be if you just opened up outlook and left it open.