'SetDescription.vbs 'Adds virtual or physical descriptor to 'computer description attribute. 'set variables 'strPrefix -- physical or virtual identifier prefix ' Prefix values: ' Ps – Physical server ' Vesx – VMware ESX VM ' Vms – Microsoft Virtual Server VM ' Vxen – Xen VM ' Vvi – Virtual Iron VM ' Vvz – SWsoft Virtuozzo virtual private server ' Vscon – Solaris Container strPrefix = "Vesx" 'strDomainTarget -- this is the AD container ' where the target computer accounts are located strDomainTarget = "cn=computers,dc=virtual,dc=net" 'strSourceFile -- file that contains computer ' account list strSourceFile = "c:\computers.txt" ' Constants Const ForReading = 1 'Open Source File Set objFSO = CreateObject("Scripting.FileSystemObject") set objSourceFile = objFSO.OpenTextFile(strSourceFile,_ ForReading, True) 'Connect to Directory Service 'Modify computer description for each computer in ' source file list Do Until objSourceFile.AtEndOfStream strcomputer = objSourceFile.Readline strADSpath = "LDAP://cn=" & strcomputer & _ "," & strDomainTarget Set objComputer = GetObject(strADSpath) strOldDes = objcomputer.description If strOldDes = "" then strNewDes = strPrefix Else strNewDes = strPrefix & " - " & strOldDes End If objcomputer.Put "Description", strNewDes objcomputer.SetInfo Loop