Hi @JYLVEN TARRAJA ,
Welcome to the Microsoft Q&A platform!
According to your description, to generate a list of all users and their recipients who have set up email forwarding, you can use the following PowerShell script to generate a list of users and their recipients with mail forwarding settings:
- Open the Exchange Management Shell.
- Run the following script:
# Get all mailboxes
$mailboxes = Get-Mailbox -ResultSize Unlimited
# Initialize an array to store the results
$results = @()
foreach ($mailbox in $mailboxes) {
# Get the forwarding settings for the mailbox
$forwardingAddress = $mailbox.ForwardingAddress
$forwardingSmtpAddress = $mailbox.ForwardingSmtpAddress
if ($forwardingAddress -or $forwardingSmtpAddress) {
$results += [PSCustomObject]@{
User = $mailbox.UserPrincipalName
ForwardingAddress = $forwardingAddress
ForwardingSmtpAddress = $forwardingSmtpAddress
}
}
}
# Export the results to a CSV file
$results | Export-Csv -Path "C:\EmailForwardingList.csv" -NoTypeInformation
This script creates a CSV file named EmailForwardingList.csv in the C:\ directory that contains a list of users and their forwarding addresses.
Please feel free to contact me for any updates. And if this helps, don't forget to mark it as an answer.
Best,
Jake Zhang