Quantcast
Channel: Active Directory – Catapult Systems
Viewing all articles
Browse latest Browse all 11

Bulk Update AD Objects with a CSV File

$
0
0

Project Description

PowerShell script that updates AD objects based on a CSV schema.

First, a big thank you to Cary Landers and Nuno Mota.
This effort was adapted from:
  1. https://companydirectory.codeplex.com/ by Cary Landers
  2. https://gallery.technet.microsoft.com/scriptcenter/f7b246a4-95a2-4408-b1a1-73b53003883c by Nuno Mota
This script does the following:
  • Iterates through records in a CSV
  • For each record, looks up the AD object’s distinguishedName based on the AccountName in the CSV
  • Updates the AD object based on the other properties specified in the CSV
The project provides both the PowerShell script and a sample CSV.  To test the script as-is, all you need to do is create three user objects in AD as testuser1, testuser2, and testuser3 (view the CSV in Excel and refer to the first column).
Once you’ve created those three users, you should be able to run the script and be able to open the attribute editor for testuser1, testuser2, and testuser3 to see their updated values.
 
Before running the script, we see that testuser3 has no address, city, state, or zip.
 
Before running the script
 
Here’s an amazing capture of what happens when you run the script.
 
Running the script
 
Finally, we check and see that testuser3 now lives somewhere!
 
After the script has been run

Viewing all articles
Browse latest Browse all 11

Trending Articles