PBIT
asked on
How to import profiles to update them?
Hello,
I like to update an attributed in a profile for users in Active directory. I like to use the Import-Csv PowerShell command to do that. What would it look like if was going to update one attribute name HireDate?
Import-Csv .\users.csv Not sure what would go here.
Users.scv would look like this:
GivenName,Surname,Name,Dis playName,S amAccountN ame,HireDa te
Bob,Jones,Bob Jones,Bob Jones, bjones, 5/5/2000
I like to update an attributed in a profile for users in Active directory. I like to use the Import-Csv PowerShell command to do that. What would it look like if was going to update one attribute name HireDate?
Import-Csv .\users.csv Not sure what would go here.
Users.scv would look like this:
GivenName,Surname,Name,Dis
Bob,Jones,Bob Jones,Bob Jones, bjones, 5/5/2000
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is no -HireDate parameter for Set-ADUser command, try with following code..
Import-Csv C:\User.csv | %{Set-ADUser $_.SamAccountName –replace @{HireDate=$_.HireDate}}
ASKER
Import-Module ActiveDirectory
Import-Csv C:\User.csv | %{Set-ADUser $_.SamAccountName -HireDate $_.HireDate}