Windows Vista Forums

(Get-Mailbox user1).primarysmtpaddress - Simple I'm sure
  1. #1


    Personne Guest

    (Get-Mailbox user1).primarysmtpaddress - Simple I'm sure

    I'm trying to get the primarysmtpaddress, into a variable

    [PS]> (Get-Mailbox user1) | fl *primary*
    PrimarySmtpAddress : user1@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 : user1@xxxxxx


    I would like to have user1@xxxxxx in $pemail

    Thanks

      My System SpecsSystem Spec

  2. #2


    adrian Guest

    Re: (Get-Mailbox user1).primarysmtpaddress - Simple I'm sure

    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()

    ?


      My System SpecsSystem Spec

  3. #3


    Personne Guest

    Re: (Get-Mailbox user1).primarysmtpaddress - Simple I'm sure

    Thank, works like a charm

    I knew it was easy

      My System SpecsSystem Spec

(Get-Mailbox user1).primarysmtpaddress - Simple I'm sure problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailbox question: Emails show up in the user computer with Cache enabled but disappear from the mailbox in the Server Pedro R. SBS Server 3 05 Nov 2009
Exchange 07 Shell - Export-Mailbox and Disable-Mailbox cmdLETS JSC PowerShell 2 04 Mar 2009
get -mailboxpermission user1 totalnet32 PowerShell 1 26 Feb 2008
User1 can print from Vista Laptop but not User2 Gordon Vista General 4 31 Dec 2007
User1 can print from Vista laptop but not User2 Gordon Vista print fax & scan 0 28 Dec 2007