You have to run PS as an administrator.
Update AD User properties via CSV file in powershell
Import-Module ActiveDirectory
$USERS = Import-CSV c:\users.csv
$empid=$USERS.employeeid
$company=$USERS.company
$title=$USERS.title
$department=$USERS.department
$Division=$USERS.division
$pobox=$USERS.pobox
$city=$USERS.city
$USERS|Foreach{
Set-ADUSer -Identity $_.samaccountname -Replace @{employeeID=$empid; company=$company; title=$title; department=$department; division=$division; postofficebox=$pobox; l=$City}
}
but I am getting insufficient rights issue where as I am an enterprise admin.
Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
5 additional answers
Sort by: Most helpful
-
Gardian Memeti 0 Reputation points
2023-01-13T11:02:52.0366667+00:00 I wanted to test it only for one user and to change the companyName how can I achieve it