Solved

LDIFDE to export info to Text file

Posted on 2008-06-25
6
1,010 Views
Last Modified: 2012-05-05
Hi,

I am trying to export information from Active Directory. the fields that I am after are Name, Username, containing OU (as we have AD split into Finance users, Support Users etc..), logon script.
I am trying to use LDIFDE to do this for me, using the command

ldifde -f search.ldf -s local.company.co.uk -d ou "Company Users", -r "(objectClass=user)"

and keep the following error message

Connecting to "local.company.co.uk"
Logging in as current user using SSPI
Exporting directory to search.ldf
Searching for entries
Writing out entries
No Entries found

The command has completed successfully

Can somebody please guide me in the right direction to get the info i need?

Many Thanks,
A
0
Comment
Question by:Lambino81
  • 3
  • 3
6 Comments
 
LVL 26

Accepted Solution

by:
farhankazi earned 350 total points
ID: 21864266
You have to specify full OU distinguished name (DN)
Like:

LDIFDE.exe -F C:\Search.ldf -S local.company.co.uk -D "OU=OUNameHere,DC=COMPANY,DC=CO,DC=UK" -R "(objectClass=user)"

Open in new window

0
 

Author Comment

by:Lambino81
ID: 21864307
Thanks for the reply,

I have now tried this and it is better, but still not producing any results as yet.

Our AD structure is as follows.....

local.company.co.uk
         Company users
                     Head Office
                              Finance Users
                                           user1
                                           user2
                              Support Users
                              Other Users
                     Remote Sites
                               Remote Users 1
                               Remote Users 2

etc......

Do I need to point LDIFDE to each OU (sub OU?), in order to get a list of users? or is there a way of listing all Head office users, regardless of which sub OU they are in?

Thanks,
A
0
 
LVL 26

Expert Comment

by:farhankazi
ID: 21864340
Yes, you need to point LDIFDE to "Head Office" OU.
To get exact OU name apply following statement on Command line (Start -> Run -> Cmd.exe -> OK)

DSQuery OU -Name "Head Office"

Above statement will provide you the exact OU name that you will specify in LDIFDE command.
0
Are your AD admin tools letting you down?

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.

 

Author Comment

by:Lambino81
ID: 21864618
Hi farhankazi,

I am still struggling with the concept of this currently,  I ran the DSQuery, and from that put together the following LDIFDE statement.

ldifde -f search.ldf -s local.company.co.uk -d ou="Head Office",ou="Company Users",dc=company,dc=co,do=uk -r "(objectClass=user)"

This is still returning no entries, and as a result, I don't know what to do next.... Is it my filter that needs to be changed?

Thanks,
A
0
 
LVL 26

Expert Comment

by:farhankazi
ID: 21864695
 ou="Head Office",ou="Company Users",dc=company,dc=co,do=uk
^      ^                   ^       ^                         ^                                           ^ --- Wrong

Again you are giving OU DN in a wrong way (simply copy & paste result received from DSQuery to LDIFDE)

OU DN should be in following format:

 "ou=Head Office,ou=Company Users,dc=company,dc=co,do=uk"
0
 

Author Closing Comment

by:Lambino81
ID: 31470500
Thankyou for your help,
I misread your original post, with relation to the "quote's".
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Companies that have implemented Microsoft’s Active Directory need to ensure that the Active Directory is configured and operating properly. If there are issues found and not resolved, it eventually leads the components to fail or stop working and fi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

943 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

6 Experts available now in Live!

Get 1:1 Help Now