On Jan 7, 3:53*pm, Personne <cpdiv...@xxxxxx> wrote:
> I'm trying to get the primarysmtpaddress, into a variable
>
> [PS]> (Get-Mailbox user1) | fl *primary*
> PrimarySmtpAddress : us...@xxxxxx
>
> I would think that would work but it doesn't
> [PS] >$pemail=(Get-Mailbox user1).primarysmtpaddress
>
> [PS] >$pemail
> Length Local
> Domain
> IsValidAddress
> ------ -----
> ------
> --------------
> * * 25 user1
> domain.com * * * * * * * * * * * * * * * * * * * * * * * * * * * True
>
> [PS]> (Get-Mailbox user1) | fl *primary*
> PrimarySmtpAddress : us...@xxxxxx
>
> I would like to have us...@xxxxxx in $pemail
>
> Thanks How about
(get-mailbox user1).PrimarySmtpAddress.ToString()
?