I want to update email in User table from the active directory. For this i am doing the following.
1. Extract all usernames from User table whose emails are not updated
SELECT username FROM `mantis_user_table` WHERE email = 'No Email' or email = '' into outfile "C:/temp/test1.txt"
2.Run command from command prompt to get the corresponding email ids from Active Directory with outputs username and email in text file
for /f %i in (test1.txt) do (dsquery user -samid %i|dsget user -empid -email|Find /V "dsget"|Find /V "empid"|Find /V "email">>C:/temp/user-email.txt)
3.Now i want to update these emails again in the User table. Can you please advice me how can i achieve step 3??