PowerShell Lab
Build, find and save PowerShell
Reviewed templates and commands with requirements, permissions and risk spelled out. Nothing here runs anything — you copy, review and run it yourself.
Search pages, tools, PowerShell commands and ports
Look up an AD account from an email or proxy address.
1#Requires -Modules ActiveDirectory2$address = 'jane.doe@example.com'3Get-ADUser -Filter "mail -eq '$address' -or proxyAddresses -eq 'smtp:$address'" -Properties mail, proxyAddresses |4 Select-Object Name, SamAccountName, mail, EnabledproxyAddresses matching is case-insensitive in AD, so smtp: also matches the primary SMTP: entry.