Relevant

A New Template for Joomla!

 

PowerShell script to enumerate rights in Exchange 2007

Source: http://www.ericwoodford.com/powershell-enumerate-delegate-rights-a-mailbox

Using the Quest Powershell addons for AD, this script reads the delegate permissions for a specified mailbox, then looks up the display name for each delegate or mailbox they are a delegate for.

$entry = Read-Host "Display name of mailbox"
if ($entry -ne $null) {
        $a= Get-QADUser $entry -ldapfilter '(mail=*)' -IncludedProperties displayname, publicdelegates, publicdelegatesbl
        foreach ($user in $a) {
                $user.displayname
                "================================="
                if ($user.publicdelegates -eq $null) {
                        Write-host "Has no delegates"
                } else
                {      
                        Write-host "Delegates:"
                    $b = $user.publicdelegates;
                        foreach ($del in $b) {Get-QADUser $del | select-object displayname| sort-object displayname};
                        "    "
                }
               
                if ($user.publicdelegatesbl -eq $null) {
                        Write-host "Is not a delegate"
                } else
                {
                                Write-Host 'Is a delegate for:'
                            $b = $user.publicdelegatesbl;
                                foreach ($del in $b) {Get-QADUser $del |select-object displayname| sort-object displayname};
                                "    "
                        }
                "    "
        }
}