Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run csvde -i -f input.csv to import directory objects from a CSV file. The -i switch is essential: without it, CSVDE runs in its default export mode. Your file’s first row names Active Directory attributes, each subsequent row supplies values, and the dn column determines where each object is created.

What CSVDE imports and how the file is interpreted

CSVDE is the Windows Server command-line utility for exporting and importing Active Directory data in comma-separated form. Microsoft describes the format as compatible with Microsoft Excel CSV files and capable of carrying Unicode text.

  • The first CSV row is the attribute header, such as objectClass, dn, and sAMAccountName.
  • Every later row describes one directory object.
  • The distinguished name (DN) identifies both the object name and its target container or organizational unit.
  • Attribute order in an exported file is not guaranteed. Microsoft notes that LDAP may return attributes in any order and CSVDE does not impose an order.

Basic CSVDE import command

csvde -i -f input.csv

-i selects import mode. If you omit it, CSVDE defaults to export. -f specifies the input or output file.

Useful command options

Option Purpose
-i Import mode; required for an import.
-f <file> Names the CSV file.
-s <domain-controller> Specifies the domain controller to contact.
-j <path> Sets the directory used for log files.
-v Enables verbose output.
-k Continues past a limited set of errors, including an already-existing object, a constraint violation, or an already-existing attribute/value. It does not make every import error harmless.

Build a user-object CSV

Microsoft’s documented sample uses these columns:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
objectClass,dn,sAMAccountName,userPrincipalName,userAccountControl
user,"CN=KMyer,CN=Users,DC=cpandl,DC=com",KenM,KenM@cpandl.com,514

This creates a row for a user object whose DN places it in the domain’s default Users container. The domain in Microsoft’s example (cpandl.com) is illustrative; replace it with the DN of your own directory.

Use the DN to select the destination

To place an object in an organizational unit, write that OU into the DN, for example:

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
objectClass,dn,sAMAccountName,userPrincipalName,userAccountControl
user,"CN=RLee,OU=Staff,DC=example,DC=com",RLee,RLee@example.com,514

The target container or OU must already exist, and the importing identity must be permitted to create the requested object and attributes there. Confirm the DN and schema in the target environment before running a bulk import.

Quote values when CSV syntax requires it

Enclose a value in double quotes when it contains a comma or other CSV-significant characters. Keep the header names identical to the LDAP attribute names expected by the directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

Password limitation and account state

CSVDE cannot set user passwords. The Microsoft Learn CSVDE command reference states: “You cannot import user passwords by using csvde because passwords must be sent over an encrypted channel.” Password provisioning therefore has to be a separate, secure operation that meets your organization’s identity and transport requirements.

Microsoft’s sample sets userAccountControl to 514. The same reference states: “Setting userAccountControl to 514 disables the user account.” Treat that value as the sample’s disabled-account behavior, not as a universal account policy. After import, use your approved password-setting and account-activation workflow; do not assume an imported user is ready for sign-in.

Rank #4
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use

Importing contacts

CSVDE can import directory objects when the CSV supplies a valid object class and the attributes required by the target Active Directory schema. Contacts are not interchangeable with users: they use a different object-class and attribute set.

Confirm the contact schema before writing columns

  1. Identify the contact object class and required attributes in the target directory’s authoritative schema or product documentation.
  2. Choose a DN for each contact that points to an existing container or OU.
  3. Build the header from the exact LDAP attribute names required for that contact class.
  4. Test one contact in a non-production OU, inspect the result, and only then prepare the full CSV.

Microsoft’s published CSVDE example demonstrates a user object, not a contact-specific schema. Consequently, do not copy the user row and merely rename it as a contact; obtain the contact class and required columns for your directory first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Run and verify the import safely

  1. Prepare a small test file. Use one or a few objects and verify every DN, object class, and attribute name.
  2. Select the domain controller if needed. Add -s when the import must target a particular controller.
  3. Enable logging and verbosity while testing. For example:
    csvde -i -f input.csv -s dc01.example.com -j C:CSVDELogs -v
  4. Review the command output and log. Check which rows succeeded and which failed before expanding the file.
  5. Verify in Active Directory tools or with an LDAP query. Confirm the object DN, class, imported attributes, and— for users—the intentionally disabled state.
  6. Repeat only after correcting failures. If an object already exists or a value violates a directory constraint, fix the CSV or the destination rather than relying on -k to conceal unrelated errors.

CSVDE versus LDIFDE

Consideration CSVDE LDIFDE
Input format Comma-separated values with an attribute header row. LDIF entries.
Natural fit Row-oriented bulk creation or exchange of directory objects. Files that explicitly describe directory changes.
Documented change types Use the CSV row structure and CSVDE command options. Microsoft documentation shows changetype: add, modify, and delete.
Schema requirement Both still require valid object classes, attributes, DNs, permissions, and constraints in the target directory.

Choose based on the file format your source system can produce and whether explicit LDIF change declarations are useful. Validate the exact operation and constraints against your current Active Directory rather than assuming one utility is universally superior.

Version and environment considerations

The principal Microsoft CSVDE command reference used for these syntax and examples is a previous-version page last updated in 2016 and lists Windows Server 2008-era through Windows Server 2012 applicability. Microsoft’s separate CSV script-format guidance is older Win32 documentation. These references establish the command form and CSV model, but they do not provide a release-by-release support matrix for every current Windows Server version or a complete permission model.

Before a production import, verify CSVDE availability, required privileges, schema, naming context, domain-controller selection, and organizational policies on the Windows Server and Active Directory version you actually operate.

Quick Recap

Bestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.34
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.