Active| Object | Control method A
LDIFDE.exe, for bulk import and export of Active Directory objects. You can use LDIFDE to import new user records into a directory, or to export specific information for a specific user to a text file. The LDIFDE default is the output mode (read information from the directory). If you add the-i option, you can also write changes to the directory (see Microsoft Knowledge Base article q237677:using LDIFDE to Import and Export Directory Objects to the Active Dir Ectory, "Import or export directory objects from Active directory using LDIFDE"). Also, if you want to export and extract specific details, such as user names, titles, and logins, for all users in a specific OU (organizational unit), you can run the following command:
Ldifde-f c:\ldif\exportusers.ldf–s servername-d "ou=yourouname,dc=yourdomainname,dc=com"-P subtree-r "(objectClass= User) "-L" cn,givenname,title,samaccountname "
Method Two
Write one yourself using the VBS script (as follows)
' Global variables
Dim Ocontainer
Dim outputfile
Dim filesystem
Set filesystem = WScript.CreateObject ("Scripting.FileSystemObject")
Set outputfile = Filesystem.createtextfile ("Asd.txt", True)
' output added to filename called Asd.txt file
Set Ocontainer = GetObject ("winnt://billgates.") ' winnt://for local name or LDAP for domain name
Enumerateusers (Ocontainer)
Outputfile.close
Set filesystem = Nothing
Set Ocontainer = Nothing
For each ouser in Ocont
Select case LCase (Ouser.class)
Case "Group"
If not IsEmpty (ouser.name) Then
Outputfile.writeline ' User: & Ouser.name ' displays group name or user name
End If
If not IsEmpty (ouser.class) Then
Outputfile.writeline "Class:" & Ouser.class ' display group type or user type
End If
If not IsEmpty (ouser.member) Then
Outputfile.writeline "Members:" & Ouser.member ' Display group member
End If
End Select
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.