Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

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

Reply
 
Old 01-07-2009   #1 (permalink)
Personne


 
 

(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
Old 01-07-2009   #2 (permalink)
adrian


 
 

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

On Jan 7, 3:53*pm, Personne <cpdiv...@xxxxxx> wrote:
Quote:

> 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
Old 01-07-2009   #3 (permalink)
Personne


 
 

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

Thank, works like a charm

I knew it was easy
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Mailbox Vista mail
Exchange 07 Shell - Export-Mailbox and Disable-Mailbox cmdLETS PowerShell
get -mailboxpermission user1 PowerShell
User1 can print from Vista Laptop but not User2 Vista General
User1 can print from Vista laptop but not User2 Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46