Link to home
Start Free TrialLog in
Avatar of Irrylyn
Irrylyn

asked on

Add info to description in AD from list

Hello Experts!!!

I have a .csv of (Column A) Computer Names and (Column B) Serial Numbers saved on my hard drive.  (Can also use txt)

My task is to update the description for each Computer Account in Active Directory with its corresponding Serial Number.

I would like a script (PS, bat, VBscript, etc) to add the Serial Number from Column B to the current description of the corresponding Computer Name in Column A in Active Directory.  (I do not want to clear out any current description.  If there is a description, I would simply like to add the SN to the end.)


Any assistance is appreciated.




------------------------------------------------------------
Not Completely Relevant Information Below:
------------------------------------------------------------
My only previous experience with this was modifying all of the descriptions to say the same thing as seen below.  But I'm not sure how to add a unique description to each computer account.  I had to do this from an Exchange server itself also.  I no longer have rights to log onto an Exchange server so must do it from my workstation with domain admin rights.

Previous .cmd I used to do a mass description change (run from Exchange Server):

@echo off
set ComputerList=C:\LocationOfMyComputerList.txt
for /f "delims=" %%a in ('type "%ComputerList%"') do (
  echo Processing %%a ...
  dsquery computer -name "%%a" | dsmod computer -desc "Mass Description Here"
)
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India 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
Avatar of Irrylyn
Irrylyn

ASKER

This worked perfectly!!!  Thank you.  It updated the description without replacing anything that was previously there, and also spit out a results file!  Wonderful, thank you!

10k computer accounts updated in minutes!
Nice!..