Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am unsuccessful at attempting the following - maybe I have not correctly grasped the connection between AD users and Exchange mailboxes, also I often fail at seeing the simple ways for manipulation in powershell:

I have several Exchange servers in my domain and need all mailboxes that are on a given server ("Foo") where the owning AD user is a member of AD group "Bar"

Thanks for any help

share|improve this question
up vote 1 down vote accepted
Get-ADGroupMember "groupName" | ForEach-Object {
    get-mailbox $_.distinguishedname |
        where-object {$_.servername -eq 'serverName'}
}

Replace groupName and serverName as appropriate.

share|improve this answer
1  
You might also want -recursive after "groupName", if you nest groups within groups. – Mark Nov 30 '12 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.