Exchange 2010: Which mailbox is linked to a specific email address?

If you want to find a email address that is used in the organisation but you don’t know the mailbox it is linked to.
This works for aliases to.

[PS] C:\Windows\system32>Get-Recipient random.email@company.com

Name                                                                    RecipientType
—-                                                                          ————-
Test User                                                              UserMailbox

 

Export all your Exchange email addresses to CSV

To create a list of all your email addresses including the primary and alias addresses run this PowerShell command;

Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-CSV c:\smtp.csv -NoTypeInformation

Command Line to list users in a Windows Active Directory Group

For a PowerShell solution that doesn’t require the Quest AD add-in, try the following
Import-Module ActiveDirectory

Get-ADGroupMember "Domain Admins" -recursive | Select-Object name 

This will enumerate the nested groups as well. If you don’t wish to do so, remove the -recursive switch.