Tuesday, December 1, 2009

List Calendar Delegates for One or More Mailboxes

A not-so-uncommon problem, at one time or another in most Exchange organizations, in when a user sends out a meeting request and receives a non-delivery report for a former employee. In most of these cases, this is caused by the former employee being listed as a delegate on another user’s calendar. Tracking down the source of this problem can be time-consuming.

Prior to Exchange 2007, this type of problem was difficult to track down, especially if the meeting request had been sent to a large group of people, because you would have to open each user’s mailbox, choose Options from the Tools menu, and then check the Delegates tab. With Exchange 2007, you can just use a powershell command to retrieve the delegates list for one or more mailboxes.

To view the delegates list for a single mailbox, use this command:

Get-MailboxCalendarSettings -Identity <mailbox> | format-list identity,resourcedelegates

To view the delegates list for all mailboxes in a distribution list, use this command:

Get-DistributionGroupMember <distribution group name> | Get-MailboxCalendarSettings | fl identity,resourcedelegates

Since most users do not have delegates, it might be useful to filter out those users with empty delegates lists, leaving only those with delegates, so let’s add a filter to the previous command:

Get-DistributionGroupMember <distribution group name> | Get-MailboxCalendarSettings | where {$_.resourcedelegates -notlike “”} | fl identity,resourcedelegates

To view the delegates list for all mailboxes in a particular database, use this command:

Get-Mailbox -Database <server\database> | Get-MailboxCalendarsettings | where {$_.resourcedelegates -notlike “”} | fl identity,resourcedelegates

To view the delegates list for all mailboxes on a particular server, use this command:

Get-Mailbox -Server <server name> -ResultSize unlimited | Get-MailboxCalendarsettings | where {$_.resourcedelegates -notlike “”} | fl identity,resourcedelegates

Finally, to view the delegates for all mailboxes in the organization, use this command:

Get-Mailbox -ResultSize unlimited | Get-MailboxCalendarsettings | where {$_.resourcedelegates -notlike “”} | fl identity,resourcedelegates

Depending on the size of your organization, these commands may take a bit of time to run.

1 comment: