Determine which groups are distribution of all the groups a AD user is a member of

Scenario:  A user is a member of multiple security and distribution groups and you wish to determine which of these groups are distribution.

Script:

$1 = (Get-ADUser STEVE -Properties Memberof).memberof
$2 = $1 | %{Get-DistributionGroup $_}

 

Archives