< Back

Get-ActiveDirectoryEmailAddress

Mon Jan 13, 2020 5:53 am

NAME Get-ActiveDirectoryEmailAddress



SYNOPSIS

Get the SMTP addresses using Active Directory.





SYNTAX

Get-ActiveDirectoryEmailAddress [-UserPrincipalName] <Object> [<CommonParameters>]



Get-ActiveDirectoryEmailAddress [-SamAccountName] <Object> [<CommonParameters>]



Get-ActiveDirectoryEmailAddress [-DistinguishedName] <Object> [<CommonParameters>]





DESCRIPTION

Get the SMTP addresses of an Active Directory object using .NET.





PARAMETERS

-UserPrincipalName <Object>

Query using UserPrincipalName



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-SamAccountName <Object>

Query using SamAccountname



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-DistinguishedName <Object>

Query using DistinguishedName



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ActiveDirectoryEmailAddress -SamAccountName cpolydorou



DistinguishedName : CN=Christos Polydorou,CN=Users,DC=LAB,DC=LOCAL

SamAccountName : cpolydorou

UserPrincipalName : cpolydorou@lab.local

SMTPAddresses : {cpolydorou@lab.local, cp@lab.local}

PrimarySMTPAddress : cpolydorou@lab.local



Get the SMTP Addresses of the user with SamAccountName "cpolydorou"











RELATED LINKS