Exchange SMTP Address Search

Welcome Forums General PowerShell Q&A Exchange SMTP Address Search

Viewing 2 reply threads
  • Author
    Posts
    • #189664
      Participant
      Topics: 1
      Replies: 0
      Points: -9
      Rank: Member

      Hi All

      Ive been building a script within exchange that allows me to search all SMTP entries.  For some reason the script is failing now but was working fine on Friday.  Any ideas what might be going on.

      Get-Recipient -resultSize unlimited | select name -expand emailAddresses | where {$_.smtpAddress -match "SMTPAddress"} | Format-Table name, smtpaddress
    • #189754
      Participant
      Topics: 9
      Replies: 1277
      Points: 1,051
      Helping Hand
      Rank: Community Hero

      Failing with what error message? What is the result and expected result?

    • #189757
      Participant
      Topics: 0
      Replies: 11
      Points: 55
      Helping Hand
      Rank: Member

      Walking through each section of your command, the "| where {$_.smtpAddress -match "SMTPAddress"}" part didn't work, so I changed it to make sure that field wasn't empty, so it changed it to "| ? {$_.SmtpAddress -ne $null}", see below.

       

      get-recipient -resultsize unlimited | select name -expand emailaddresses | ? {$_.SmtpAddress -ne $null} | ft Name,SMTPAddress -auto

Viewing 2 reply threads
  • You must be logged in to reply to this topic.