Domain name/ email address search in exchange by using Powershell

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of AniyaNetworks AniyaNetworks 6 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36281
    Profile photo of AniyaNetworks
    AniyaNetworks
    Participant

    Hello , i would like to make a script that will help me to know, how many user is using this domain name as primary emails.

    My script is :

    $Emailaddress = Read-Host "`nPlease Enter the Email Addressess (e.g: financexx)"

    Get-Mailbox -Filter {Emailaddresses -like "$Emailaddress"}

    #Get-Mailbox -Filter {Emailaddresses -like "*hollis*"} (when i try this i am getting reply)

    but my script is not returning any result. please advise.

    #36288
    Profile photo of Stig Sörnsen
    Stig Sörnsen
    Participant

    Hi,

    Try including the wildcards like this:

    Get-Mailbox -Filter {Emailaddresses -like "*$Emailaddress*"}

    Best regards
    Stig

    #36308

    Try with the below syntax

    Get-Mailbox -Filter "emailaddresses -like '*$emailaddress*'"

    #36316
    Profile photo of AniyaNetworks
    AniyaNetworks
    Participant

    Thank you guys,
    Nagendra Narembally@ i tried your syntax and it did work. Thank you

    Thanks guys taking time to solve my problem.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.