PowerShell Script for Accessing Sent Emails in Outlook and Exchange
I am developing a PowerShell script to retrieve sent email IDs from my Outlook sent mailbox for both the "To" and "CC" sections, from the beginning of the email account to the current date. I managed to create a script that works for a single user; however, it prompts for a notification acceptance when running in PowerShell.
The updated requirement is to extend this functionality to multiple users. The script should connect to the Exchange module with global admin credentials, access the Exchange Admin Center, and then loop through a list of users specified in the script. The goal is to access each user's sent mailbox to copy the sent email IDs and generate the output.
I am encountering errors while attempting to connect and access users in this manner. Assistance is needed in finding the correct command to connect to this environment.