There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Networking
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory modem monitor motherboard network printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Networking >
Solved: Exporting AD Users using a filter

Reply  
Thread Tools
asgt's Avatar
Member with 53 posts.
 
Join Date: Jan 2007
Location: Northern England
Experience: Advanced in some areas...
04-Sep-2008, 01:20 PM #1
Solved: Exporting AD Users using a filter
Hi Guys,

I don't know to much about LDAP queries so I hope someone can help me out!

I have an LDAP filter which I can use in ADUC to see which users have Outlook Web Access enabled. If it helps, the filter is " (& (objectClass=user)(homeMDB=*)(!protocolSettings=HTTP§0§1§§§§§§)) ".

If I want to export the users who show when the filter is applied to a .csv file, I have to go to each OU individually and export each to a separate file. We have separate OUs for Branch staff and Head Office staff. The Head Office OU is further divided by department.

I have found a website explaining the use of CSVDE (here). It explains the use of the -f and -r switches (eg CSVDE -f export.csv -r "(&(objectClass=user)(sn=Thomas))" ).

I was wondering if it was possible use CSVDE with the LDAP filter to only export the filtered sample?


If it doesn't make sense, let me know and I'll try to clarify!
Thanks for any help.

Andy
__________________
Welcome to "The Learning Curve". Please mind the knowledge gap.
Kirok's Avatar
Senior Member with 223 posts.
 
Join Date: Apr 2006
Location: Highlands, Scotland, UK
Experience: Sysadmin
04-Sep-2008, 04:12 PM #2
Yeah that should work no problem sometimes theres is an issue with wildcards but the query looks okay.

You could also use LDIFDE, heres a couple of articles talking you through it if you need more

http://searchwindowsserver.techtarge...191071,00.html
http://searchwindowsserver.techtarge...192536,00.html

More info on CSVDE also, rather than me paraphrasing http://exchangeis.com/blogs/exchange...d-example.aspx
asgt's Avatar
Member with 53 posts.
 
Join Date: Jan 2007
Location: Northern England
Experience: Advanced in some areas...
04-Sep-2008, 04:46 PM #3
Thanks for the links - they look very promising.

I'll give it a try in the morning and report back.

Andy
asgt's Avatar
Member with 53 posts.
 
Join Date: Jan 2007
Location: Northern England
Experience: Advanced in some areas...
05-Sep-2008, 12:22 PM #4
Using the links Kirok supplied proved helpful although maybe a little above my level!!

I have composed the following query = csvde -f c:\owa_on.csv -r (& (objectClass=user)(homeMDB=*)(!protocolSettings=HTTP§0§1§§§§§§))

When I try to run this, I get the following message "(homeMDB was unexpected at this time". Could this be because I haven't told it which domain or OU to look in?

My limited knowledge suggests something like "DC=mydomainhere DC=net" would need to go somewhere but I'm not sure on the correct syntax (I think thats the right word!). Would anyone be able to help me out?


Also, I can see a lot of benefit to using this tool (and LDIFDE) so if anyone could recommend a good training course (in the UK) or a good book or website I'd much appreciate it!!


Many thanks

Andy
Kirok's Avatar
Senior Member with 223 posts.
 
Join Date: Apr 2006
Location: Highlands, Scotland, UK
Experience: Sysadmin
06-Sep-2008, 11:47 AM #5
Yeah probably because it doesn't know where to look. I know of no training for this specifically. I think O'Reilly has an an active directory cookbook though.

Anyway just try this.

Who has OWA disabled
Code:
dsquery * -filter "&(objectcategory=person)(objectclass=user)(mailnickname=*)(protocolsettings=HTTP?0*)"
Who has OWA enabled
Code:
dsquery * -filter "&(objectcategory=person)(objectclass=user)(mailnickname=*)(homemdb=*)(!protocolsettings=HTTP?0*)"
Then pipe the output to a file if needed. Those other tools can be used for this but I prefer this one.

The protocol setting could change based on version I think for Exchange 2003 its (protocolsettings=HTTP?0*) and for 2007 its (protocolsettings=*OWA?0*) yours could be different though.
asgt's Avatar
Member with 53 posts.
 
Join Date: Jan 2007
Location: Northern England
Experience: Advanced in some areas...
17-Sep-2008, 06:35 AM #6
Managed to get it working by opening ADUC going into Saved Queries and creating a Custom Query with (& (objectClass=user)(homeMDB=*)(!protocolSettings=HTTP§0§1§§§§§§)) in the LDAP filter.

Works a charm! Now to sort Outlook Mobile Access (check the new thread)!!!
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:42 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.