• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

2003 AD Query

I'm trying to create a query on 2003 SBS server to grab the following. I would like an export of each user, user name, email addresses

I can't find any predefinded queries to accomplish this. Please advise on how i could get that information.

Thanks
0
webiis
Asked:
webiis
  • 5
  • 5
1 Solution
 
Joseph DalyCommented:
The following will work using the build in DS series of tools.
dsquery user -samid * -limit 0 | dsget user -ln -fn -samid -email >c:\users.txt
0
 
Joseph DalyCommented:
And a second method using the Quest powershell cmdlets.

get-qaduser | select-object firstname,lastname,email,samaccountname | export-csv c:\users.csv
0
 
webiisAuthor Commented:
This is pretty close. I need username, all email addresses associated with that user, primary email address, full name.  I'm moving from 2003 sbs to 2010 exchange and going to do everything fresh. I'm looking for a way to streamline the process to of creating the users on the exchange 2010 server.

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Joseph DalyCommented:
Ok this might make it a little bit messy because all of the email addresses are stored in an array called proxyaddresses. Give below a shot and let me know.

get-qaduser | select-object firstname,lastname,email,samaccountname,proxyaddresses | export-csv c:\users.csv
0
 
webiisAuthor Commented:
The source server is exchange 2003 SBS, so the query failed.
0
 
Joseph DalyCommented:
I dont think that should cause a problem with the script.

Try this and let me know if it works.

get-qaduser {username} | select-object proxyaddresses

0
 
webiisAuthor Commented:

C:\>get-qaduser {username} | select-object proxyaddresses
'get-qaduser' is not recognized as an internal or external command,
operable program or batch file.

C:\>
0
 
Joseph DalyCommented:
Oh ok you just need to install the quest cmdlets on your workstation.
http://www.quest.com/powershell/activeroles-server.aspx

These dont need to be installed on the server just your management workstation.
0
 
webiisAuthor Commented:
well i only have RDP access to the server. Is there any harm in installing this on the server?
0
 
neothwinCommented:
csvde -f ourput.csv -r "(proxyaddresses=*)" -l Displayname,proxyaddresses,mail,sn,givenname

To filter only users with mailbox (excluding groups and contacts),
csvde -f ourput.csv -r "((Homemdb=*)" -l Displayname,proxyaddresses,mail,sn,givenname
0
 
webiisAuthor Commented:
your query worked. you saved me a lot of time. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now