# appending active directory through powershell

**URL:** <https://forums.powershell.org/t/appending-active-directory-through-powershell/1226>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/appending-active-directory-through-powershell/1226 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/appending-active-directory-through-powershell/1226/1 "2011-12-31T18:30:00Z")

</div>

by Peeps3240 at 2012-08-31 08:55:41

> Good morning, 2nd time poster short time reader  
>   
>   
> our active directory is not nearly as populated as it should be, ie missing phone numbers, job titles, departments…  
>   
> i have a CVS file with all this information that i pulled in from various spreadsheets through VLOOKUP and it is as up to date as i can get it.  
>   
> I have seen suggestions to use LADP to do this and i have seen instructions on how to create new users through a CSV import in LADP and PowerShell but i am worried that it wont just update but create new users of these entries with no passwords.  
>   
> `	OU	Name	Type	Description	Modified	Business Phone	City	Company	Country/Region	Department	Display Name	E-Mail Address	Exchange Alias	Exchange Mailbox Store	First Name	Instant Messaging Home Server Instant Messaging URL Job Title	Last Name	Office	Phonetic Company Name	Phonetic Department	Phonetic Display Name	Phonetic First Name	Phonetic Last Name	State	User Logon Name	Zip Code`  
>   
> these are all the various fields i pulled from active directory by doing the export command from each OU. to import these to update the various fields that are blank (noted by a #NA) is this possible without recreating each user in the OU?

by DonJ at 2012-08-31 11:11:08

> That’s not much of a worry if you’re using the Quest AD cmdlets or the Microsoft AD cmdlets, as there are separate commands for creating and modifying (e.g., Set-QADUser or Se-ADUser vs. New-QADUser or New-ADUser). In other words, the "Set" commands change things, but have to be told which account to change, and can’t create a new account at all.  
>   
> So it’s certainly possible to do what you want. I’m not suggesting using LDAP to do this, though.  
>   
> `Import-CSV your-file.csv | ForEach-Object { Get-ADUser -filter { displayname -eq $.‘Display Name’ } | Set-ADUser -City $.City -Department $.Department (etc)}`  
>   
> _So this is just a snippet, and I’m using the Microsoft ActiveDirectory module (which is in the Win7 RSAT download, and can run against a Win2008R2 domain controller; it’ll run against a Win2003 or Win2008 domain controller if the DC is running the AD Management Gateway download). Notice how I used the **$** _ **.‘Display Name’** syntax to refer to a specific field from the CSV file. I did the same thing with **$_.City_** _and **$** _ **.Department** , and you could extend that to refer to whatever other properties you want to update.  
>   
> There are probably several other ways to accomplish this… so if any other readers here want to jump in with suggestions, please do!

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:02pm UTC](https://forums.powershell.org/t/appending-active-directory-through-powershell/1226/2 "2024-05-16T21:02:32Z")

</div>


