Solved

Exchange 2010  user query

Posted on 2013-01-03
4
287 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 43

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 400 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 100 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
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 use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

726 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