Solved

Use PowerShell to extract and user/dl with specific domain

Posted on 2013-05-29
5
382 Views
Last Modified: 2013-05-29
Hello All,
I'm trying to find a way to extract users and groups with a specific email address (ie, @abc.com) and save it as an excel file.

someone asked me for all users and DL's ending in a sepecific domain email address. We receive email from a few domains and in AD i dont see an easy way to do that.

i was hoping EMS would be able to do this.
0
Comment
Question by:msidnam
  • 4
5 Comments
 
LVL 14

Expert Comment

by:Ben Hart
Comment Utility
0
 
LVL 14

Expert Comment

by:Ben Hart
Comment Utility
wait hold on.. thats not right..
0
 
LVL 14

Expert Comment

by:Ben Hart
Comment Utility
get-recipient -ResultSize unlimited | where {$_.emailaddresses -match “test.local“} | select name,emailaddresses > c:\out.txt
0
 
LVL 14

Expert Comment

by:Ben Hart
Comment Utility
Or maybe better..

Get-Mailbox -resultsize unlimited | Select-Object displayname -expandproperty emailaddresses| Where-Object {$_.smtpaddress -like "*domain.com*"}| Select-Object displayName,SmtpAddress | Export-csv C:\domain.csv
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
Comment Utility
You need to filter the groups and User mailboxes from Get-recipient command output.. For example..
Get-recipient -ResultSize unlimited | ?{($_.RecipientType -match "Group" -or $_.RecipientType -eq "UserMailbox") -and $_.emailaddresses -match "Test.com"} | Export-Csv C:\report.csv -NTI

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now