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?