locked
Finding list of users with same email address RRS feed

  • Question

  • Hi

    Running Exchange 2007 SP3.

    We have multiple domains within our Exchange infrastructure - domain1.com, domain2.com, domain3.com etc. We also have numerous Exchange servers, grouped and named according to their location, e.g. Tokyo-Mail1, Mumbai-Mail1, London-Mail3 etc.

    I need to pull off a list of everyone with an email address of <user>@domain.com2 on just Tokyo servers (Tokyo-Mail1, Tokyo-Mail2....up to Tokyo-Mail10).

    Does anyone know how I can do this?

    Wednesday, August 17, 2011 5:48 PM

Answers

  • I think you need to use “-like” not “-eq”.

    Run this command:

    Get-mailbox –DomainController  ToKyoDC.domian.com |Where {$_.EmailAddresses –like “*@domian.com3”}


    Because you have several Exchange servers in ToKyo, So you had better use "DomianController". The "-server" specifies the Exchange server.
    • Marked as answer by Jerome Xiong Friday, August 26, 2011 3:07 AM
    Friday, August 19, 2011 3:43 AM
  • I'd need to use -like if I was matching the entire address string. 

    The domain part is available as the .domain property of the address.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by Jerome Xiong Friday, August 26, 2011 3:07 AM
    Friday, August 19, 2011 3:15 PM

All replies

  • Email addresses are stored in Active Directory, not on the mail servers.  The location of the Exchange server won't matter.  What matters is what AD domain the user is in. 
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Wednesday, August 17, 2011 6:02 PM
  • I may have misread the question.  Are you wanting a list mailboxes?

    Waring: air code

    1..10 | foreach {
    get-mailbox -server tokyo-mail$_ |
    where {$_.primarysmtpaddress.domain -eq "domain2.com"}
    }

     


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Wednesday, August 17, 2011 6:11 PM
  • I think you need to use “-like” not “-eq”.

    Run this command:

    Get-mailbox –DomainController  ToKyoDC.domian.com |Where {$_.EmailAddresses –like “*@domian.com3”}


    Because you have several Exchange servers in ToKyo, So you had better use "DomianController". The "-server" specifies the Exchange server.
    • Marked as answer by Jerome Xiong Friday, August 26, 2011 3:07 AM
    Friday, August 19, 2011 3:43 AM
  • I'd need to use -like if I was matching the entire address string. 

    The domain part is available as the .domain property of the address.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by Jerome Xiong Friday, August 26, 2011 3:07 AM
    Friday, August 19, 2011 3:15 PM