One problem that I sometimes face is how to help businesses manage their contact information. This is certainly a large enough topic to warrant many articles, but one tiny step forward is to update the Global Address List with the user contact info. Problem is that this info is only stored in the user’s AD object, so you would need to set up an admin assistant with restricted rights and teach them to use ADUC, etc. An alternate approach is to script a solution. Of course, it would be best if the info was added when the user was created, but phone numbers aren’t always available during the initial setup and they can change.
Once the info is in the GAL, BlackBerry and WIndows Mobile users can access it too.
I looked at a bunch of tools to update existing users in AD with contact info. CSVDE, LDIFDE, etc. but it looks like DSMOD is the way to go:
- First you need your phone list in XLS format
- export just the Name (should match CN from next step, for us it is “First name then last name with a space between”), telephone and mobile as a CSV to contacts.txt
- Export users from AD into a text file
- dsquery user -limit 0 > dn.txt
- Check out this nice batch file which will find the DN for each user and output the correct DSMOD command
- @echo off
for /f “tokens=1,2,3,4 delims=,” %%a in (contacts.txt) do call :check %%a %%b %%c %%d
for /F “delims=:” %%a in (‘findstr /C:”%1 %2″ dn.txt’) do echo dsmod user %%a -tel “%3” -mobile “%4”
- @echo off