Solved

Exchange 2010  user query

Posted on 2013-01-03
4
280 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
In this video we show how to create an Accepted Domain 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 >> Ac…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

763 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

7 Experts available now in Live!

Get 1:1 Help Now