Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LDIFDE to export info to Text file

Posted on 2008-06-25
6
Medium Priority
?
1,026 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 1400 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:Farhan Kazi
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
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

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:Farhan Kazi
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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  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

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

715 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