Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.