?
Solved

Exchange 2010  user query

Posted on 2013-01-03
4
Medium Priority
?
289 Views
Last Modified: 2013-02-04
Hi,
I need to run a query (I'm guessing in powershell) that will give me a list of my email users and their email addresses.
I did some searching online and came up with this:
get-recipient | where {$_.emailaddresses -match "mydomain.com"}  | select Firstname, emailaddresses

This query works to a degree. But I have a few questions:
1. Regarding the fields I am  using the select on (Firstname, emailaddresses). Where can I find a list of field names that I can query against.
2. How to I export the results of this query to a text file?

Thanks!
M
0
Comment
Question by:nachtmsk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 44

Expert Comment

by:Amit
ID: 38740147
Ya PS can do it, why don't you first try with EMC and export the result.
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 38740185
1.)
Get-Recipient "Username" | FL
Get-Mailbox "Username" | FL
Get-User "Username" | FL

2.)
At the last use > c:\user.txt

- Rancy
0
 
LVL 23

Accepted Solution

by:
Stelian Stan earned 1600 total points
ID: 38740194
to find the list with all the name fields just run:
Get-Recipient -Identity testuser | fl

to export:
get-recipient | where {$_.emailaddresses -match "mydomain.com"}  | select Firstname, emailaddresses | Export-CSV C:\Temp\test.csv
0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 400 total points
ID: 38740405
You may have to add -ResultSize Unlimited to search all users, by default search will include only 1000 recipient objects (If you have less that 1000 recipient objects in your AD then it's not necessary)

Also select * will give you all properties to export. You can also select each properties as mentioned in above posts..

Get-Recipient -ResultSize Unlimited | where {$_.emailaddresses -match "mydomain.com"}  | select * | Export-CSV c:\result.csv

Open in new window


emailaddresses is a multivalued property so you need to use Select {$_.emailaddresses} to view the correct result while exporting..
Get-Recipient -ResultSize Unlimited | where {$_.emailaddresses -match "mydomain.com"}  | select Firstname,{$_.emailaddresses} | Export-CSV C:\result.csv

Open in new window

Get-Recipient UserA | GM | ?{$_.Membertype -eq "Property"} will also show you the properties which you can select..
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 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