I'm looking for guidance on the right script to use for verifying which emails a specific user has delegation access to. If anyone has a way to get this information, I'd really appreciate it!
3 Answers
You'll want to connect to your Exchange Online instance and then run a straightforward script to get the list of mailboxes a user has access to. Here's a useful snippet you can try:
```
Connect-ExchangeOnline -UserPrincipalName [email protected]
Get-Mailbox | Get-MailboxPermission -User [email protected] -ResultSize Unlimited | Export-Csv PATH.csv
Disconnect-ExchangeOnline
```
Keep in mind that the output might include more than just full access rights, so it could be a bit detailed depending on your organization's mailboxes.
Honestly, it's tough to give you an exact script without knowing more details about your email system. Are you on Exchange, Microsoft 365, or something else? Here's a more generic example if you're on 365:
```
$users = @(
"[email protected]",
"[email protected]",
"[email protected]"
)
foreach ($user in $users) {
Get-Mailbox -ResultSize Unlimited |
Get-MailboxPermission -User $user |
Where-Object { $_.AccessRights -contains "FullAccess" -and $_.IsInherited -eq $false } |
Select-Object @{Name='Mailbox';Expression={$_.Identity}}, @{Name='User';Expression={$_.User}}, @{Name='AccessRights';Expression={$_.AccessRights}} |
Export-Csv -Path "C:ReportsFullAccessPermissions_$($user -replace '@','_').csv" -NoTypeInformation
}
```
Hope that gives you a starting point!
If you're specifically looking for a list of mailboxes a user can access, check out this GitHub link. It provides a script that can help you export the results:
[GitHub Link](https://github.com/admindroid-community/powershell-scripts/tree/master/List%20Mailboxes%20Users%20Can%20Access)
Once you have that, you can run it to get the details you need.
Related Questions
File Hash Generator Online – Get Instant MD5 and SHA-256 Hashes
Visual CSS Editor for Modern Glass UI Effects
Glassmorphism CSS Generator with Live Preview
Online Hash Generator - String to Hash Converter
Convert CSV To HTML Table
Convert Json To Xml