Jan Ryen

Jan Ryen

Be influential or be influenced by others

Jan Ryen

  • Home
  • Readinglist
  • Course list
  • Blog

Find SMTP addresses using ActiveDirectory module in PowerShell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# On a DC, in Powershell:
#See all smtp addresses for specific AD User
Get-ADObject -Properties proxyAddresses -Filter {samaccountname -eq "ADUserSamAccountName"} | select -ExpandProperty proxyaddresses
 
#See all smtp addresses by searching for parts of an smtp address
Get-ADObject -Properties mail, proxyAddresses -Filter {mail -like "*portionOfMailAddress*"} | select -ExpandProperty proxyaddresses
 
 
# If you have RSAT ( which you should ) on your own PC:
#get the credetial of an administrative user
$cred = Get-Credential DOMAIN\User
 
# Import the Active Directory Module
Import-Module ActiveDirectory
 
#See all smtp addresses for specific AD User
Get-ADObject -Credential $cred -Properties proxyAddresses -Filter {samaccountname -eq "ADUserSamAccountName"} | select -ExpandProperty proxyaddresses
 
#See all smtp addresses by searching for parts of an smtp address
Get-ADObject -Credential $cred -Properties mail, proxyAddresses -Filter {mail -like "*portionOfMailAddress*"} | select -ExpandProperty proxyaddresses

 

  • ← How to get server core to always start with powershell on login
  • Get last logged on user with PowerShell →
  • My YouTube channel
  • Terms of Service and Privacy Policy
© 2019 Jan Ryen | Designed by: Theme Freesia | Powered by: WordPress
We use cookies to personalize content, to provide social media features and to analyze our traffic. Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously. Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region you are in. You consent to our cookies if you continue to use our website.AcceptRejectPrivacy policy and ToS
Revoke cookies