Feedback by UserVoice

Jason

My feedback

  1. 1,329 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    42 comments  ·  Office 365 Admin » Exchange Admin  ·  Flag idea as inappropriate…  ·  Admin →
    Jason commented  · 

    If you're in a hybrid configuration with Azure AD Connect you can do this in powershell. Hope this helps someone.

    Sorry it's not commented or pretty, busy days this month.

    Import-Module ActiveDirectory

    $automapped = Get-ADUser -Filter * -Properties msexchdelegatelistlink, UserPrincipalName |
    where {$_.msexchdelegatelistlink -ne ""} |
    Select-Object name, @{N="msExchDelegateListLink"; e={$_.msexchdelegatelistlink}}, UserPrincipalName
    $targets= @()

    foreach($User in $automapped)

    {
    $Delegates = $user | select @{ N="Name"; e= {$_ |select -ExpandProperty MsExchDelegateListLink}}
    $delegatesExp = $Delegates | Select -ExpandProperty Name
    foreach($delegate in $delegatesExp)

    {
    If ($delegate -notlike "CN=Administrator*")

    {
    $DelegatedUserUPN = Get-ADUser -Identity ($Delegate.tostring()) -Properties Userprincipalname | Select UserPrincipalName
    $DelegatedName = ($Delegate.split(",")[0]).replace("CN=","")
    $target = New-Object psobject
    $target | Add-Member -type noteproperty -Name "User Name" -Value ($user.Name) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUser" -Value ($DelegatedName) -force
    $target | Add-Member -type noteproperty -Name "UserPrincipalName" -Value ($user.UserPrincipalName) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUser" -Value ($DelegatedName) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUserUPN" -Value ($DelegatedUserUPN.UserPrincipalName) -force
    $targets += $target

    }
    }

    }

    $targets | Export-Csv C:\SCRIPTS\AutoMapped_Mailboxes_With_Delegates.csv -NoTypeInformation

  2. 226 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    14 comments  ·  Office 365 Admin » Exchange Admin  ·  Flag idea as inappropriate…  ·  Admin →
    Jason supported this idea  · 
    Jason commented  · 

    You can do this with PowerShell. Hopefully this helps someone. Sorry it's not commented or pretty, busy days this month.

    Import-Module ActiveDirectory

    $automapped = Get-ADUser -Filter * -Properties msexchdelegatelistlink, UserPrincipalName |
    where {$_.msexchdelegatelistlink -ne ""} |
    Select-Object name, @{N="msExchDelegateListLink"; e={$_.msexchdelegatelistlink}}, UserPrincipalName
    $targets= @()

    foreach($User in $automapped)



    {
    $Delegates = $user | select @{ N="Name"; e= {$_ |select -ExpandProperty MsExchDelegateListLink}}
    $delegatesExp = $Delegates | Select -ExpandProperty Name
    foreach($delegate in $delegatesExp)

    {
    If ($delegate -notlike "CN=Administrator*")

    {
    $DelegatedUserUPN = Get-ADUser -Identity ($Delegate.tostring()) -Properties Userprincipalname | Select UserPrincipalName
    $DelegatedName = ($Delegate.split(",")[0]).replace("CN=","")
    $target = New-Object psobject
    $target | Add-Member -type noteproperty -Name "User Name" -Value ($user.Name) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUser" -Value ($DelegatedName) -force
    $target | Add-Member -type noteproperty -Name "UserPrincipalName" -Value ($user.UserPrincipalName) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUser" -Value ($DelegatedName) -force
    $target | Add-Member -type noteproperty -Name "DelegatedUserUPN" -Value ($DelegatedUserUPN.UserPrincipalName) -force
    $targets += $target

    }
    }


    }

    $targets | Export-Csv C:\SCRIPTS\AutoMapped_Mailboxes_With_Delegates.csv -NoTypeInformation

Feedback and Knowledge Base