Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Split properties in Exchange

$
0
0

Im running the following command without issue:

(get-mailbox | Where {(($_.ServerName -eq "Mail01") -and ($_.Alias -eq "crizzo"))} | Select-Object EmailAddresses)

Output:

EmailAddresses
--------------
{sip:crizzo@abc.com, SMTP:crizzo@abc.com, X400:C=US;A= ;P=abc;O=NYC;S=rizzo;G=Charlie;}

When I run the same command using the .split method I am getting the following error:

(get-mailbox | Where {(($_.ServerName -eq "Mail01") -and ($_.Alias -eq "crizzo"))} | Select-Object EmailAddresses).split(""SMTP:")[1]

Method invocation failed because [Selected.Microsoft.Exchange.Data.Directory.Management.Mailbox] doesn't contain a meth
od named 'split'.

How can I treat this as a string so I can use the .split method? My goal it to capture the SMTP address by its self for examplecrizze@abc.com

Any Ideas? 


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>