Exportando usuarios do AD para um arquivo texto

From Wiki

An export of an Active Directory user account is helpful for any application that uses an external LDAP since the LDAP is usually the first thing checked when login issues occur. An LDAP export is also helpful if you want to pull a list of users from one corporate directory into another, or if you want to establish a new LDAP account.

TO EXPORT AN ACTIVE DIRECTORY USER ACCOUNT

1. Open a command prompt, type

> ldifde

and press ENTER.

2. Type the following commands together (see the example in Step 3).

  • Type "-f ..." (path you to which you want the file exported), for example, c:\yourFile.
  • Type "-s ..." (server name), for example, your.server.com.
  • Type "-t ..." (LDAP port), for example, 389.
  • Type "-d ..." (scope), for example, "Cn=Users,DC=yourDomain,DC=com".
  • Type "-p ..." (subtree).
  • Type "-r ..." (filter), for example, "(objectClass=*)", or, "(&(objectCategory=person)(objectClass=User)(givenname=*))". The second suggestion is recommended.
  • Type "-l ..." (list of Active Directory Attributes separated by a comma), for example, "cn,givenName,objectclass,sAMAccountName,mail".

3. Put the command together as follows:

C:\> ldifde -f C:\CraigvincentDomainUsers.ldf -s gavin.craigvincent.com -t 3268 -d "CN=Users,DC=craigvincent,DC=com" -p subtree -r "(&(objectCategory=person)
(objectClass=User)(givenname=*))" -l "cn,givenName,objectclass,samAccountName"

ou

C:\> ldifde -f C:\EmpresaX.ldf -s catira -t 3268 -d "DC=empresaX,DC=com,DC=br" -p subtree -r "(&(objectCategory=person)(objectClass=User)(givenname=*))"
         -l "cn,givenName,objectclass,samAccountName"

4. Press ENTER. Note the following output:

Connecting to "gavin.craigvincent.com"
Logging in as current user using SSPI
Exporting directory to file C:\CraigvincentDomainUsers.ldf
Searching for entries...
Writing out entries.......
7 entries exported

The command has completed successfully


Ver também