Author Posts

March 8, 2016 at 11:48 am

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.

March 8, 2016 at 1:27 pm


Try including the wildcards like this:

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

Best regards

March 9, 2016 at 3:15 am

Try with the below syntax

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

March 9, 2016 at 7:46 am

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

Thanks guys taking time to solve my problem.