Link to home
Start Free TrialLog in
Avatar of npc_caseym
npc_caseymFlag for United States of America

asked on

Scripting bulk user edit in AD

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 CSV...is that possible?

Thanks,
Casey

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

Open in new window

Avatar of becraig
becraig
Flag of United States of America image

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial