Solved

LDIFDE to export info to Text file

Posted on 2008-06-25
6
1,009 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
 

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

Join & Write a Comment

The saying goes a bad carpenter blames his tools. In the Directory Services world a bad system administrator, well, even with the best tools they’re probably not going to become an all star.  However for the system admin who is willing to spend a li…
Resolve DNS query failed errors for Exchange
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…
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 …

746 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

12 Experts available now in Live!

Get 1:1 Help Now