Link to home
Start Free TrialLog in
Avatar of Mark
MarkFlag for Ireland

asked on

Powershell Script to List Domain Admins with Mailboxes in Exchange 2010

Hi,

Do you know Powershell command or script I can use to list Domain Admins with Mailboxes in Exchange 2010

Best Regards,

Mark
Avatar of Tom Cieslik
Tom Cieslik
Flag of United States of America image

For example this one.
You will get Domain admin, Group name in DC and Last Logged time

Get-ADGroupMember "Domain ADmins" | Get-AdUser -Property LastLogonDate | select name,distinguishedName,LastLogonDate

Open in new window

Avatar of Mark

ASKER

Hi thanks for that but will the PowerShell command also show that the Group member also has a Mailbox?
You can try this one

$mailboxes = @(Get-ADGroupMember "Domain Admins" | ForEach-Object { get-mailbox $_.distinguishedname })

Open in new window


This will work if all members has mailbox
ASKER CERTIFIED SOLUTION
Avatar of Mahesh
Mahesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Mahesh, does the Power Shell script can be executed on Exchange 2013 or 2016 as well ?
The script can be executed from any server where AD PowerShell module is available
So does your exchange servers also have ad PowerShell module so you can execute from there as well