Scripting bulk user edit in AD

Posted on 2014-08-12
Last Modified: 2015-02-04
I have a Powershell script to modify the extensionAttribute2 attribute for a list of AD users (from a CSV).  How would I add a field to it?  If I wanted to update the Organization AD field with data in the second column of the that possible?


Here's my current script:
Import-Csv C:\USER.CSV | %{
Set-ADUser -Identity $_.Name -replace @{extensionAttribute2="myValue"}

Open in new window

Question by:npc_caseym
    LVL 28

    Expert Comment

    Import-Csv C:\USER.CSV | %{
    Set-ADUser -Identity $_.Name -replace @{extensionAttribute2="myValue";  Organization AD="myvalue2"}

    Open in new window

    LVL 40

    Accepted Solution

    Import-Csv C:\USER.CSV | %{
    Set-ADUser -Identity $_.Name -replace @{extensionAttribute2="myValue"} -Organization $_.Organization

    Open in new window

    USER.CSV sample shown below..

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    md5sum check using powershell v 1.0 4 36
    Powershell script explanation 10 32
    GPO Access denied in AD 12 20
    DFS Question 4 19
    In this previous article (, we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
    Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now