Link to home
Start Free TrialLog in
Avatar of Thor2923
Thor2923Flag for United States of America

asked on

I need help with Powershell and importing Active Directory data from a CSV file to actual user accounts

I just received help pulling active directory data from users in a specific OU into a CSV file. I now have a report of everyone's email address and phone number and am aware of the users that are missing those fields. I was hoping I could use the same CSV file to make modifications to the telephone and email columns and import the data back into active directory. In other words all our of active directory users need to have telephone numbers and email addresses on the General Tab, but some are missing. I hope to fill in the missing information on the CSV file and import it into active directory so I will not have to open and modify each individual ADUC account. Is there a powershell command that will let me do this? Below is basically the script I used to create the results.csv file. How can I fill in the blank data and get it back into AD?

 
Import-module activedirectory
Get-ADUser -Filter * -SearchBase "ou=dallasusers,ou=dallas,ou=texas,dc=youdomain,dc=com" -Properties DisplayName, Mail, TelephoneNumber |
? { ($_.TelephoneNumber -ne $null) -aor ($_.Mail -ne $null) } | select DisplayName, mail, telephonenumber |
Export-csv "c:\results.csv" -nti
ASKER CERTIFIED SOLUTION
Avatar of dan_blagut
dan_blagut
Flag of France 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