Exportando usuarios do AD para um arquivo texto: Difference between revisions

From Wiki
No edit summary
 
Line 3: Line 3:
'''TO EXPORT AN ACTIVE DIRECTORY USER ACCOUNT'''
'''TO EXPORT AN ACTIVE DIRECTORY USER ACCOUNT'''


1. Open a command prompt, type (all commands should be typed without quotes) "ldifde," and press ENTER.
1. Open a command prompt, type  


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


-- Type "-f ..." (path you to which you want the file exported), for example, c:\yourFile.
and press ENTER.


-- Type "-s ..." (server name), for example, your.server.com.
2. Type the following commands together (see the example in Step 3).
 
-- 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".
* 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:
3. Put the command together as follows:


C:\Documents and Settings\Administrator>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"
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
ou


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


4. Press ENTER. Note the following output:
4. Press ENTER. Note the following output:


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


The command has completed successfully
The command has completed successfully

Latest revision as of 13:56, 12 November 2015

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