Solved

Exchange 2010  user query

Posted on 2013-01-03
4
281 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
4 Comments
 
LVL 41

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

Being driven mad by email signature updates?

Having to make a change to your users’ email signatures, yet again? Feel like your head is going to explode? Rely on an Exclaimer email signature management solution to make the process simple!

Question has a verified solution.

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

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

911 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

20 Experts available now in Live!

Get 1:1 Help Now