The above code extracts common names to column 1 and active directory paths to column 2. Then searches column 1 for accounts with common names "a1", "a2" and "a3", all non-matching rows are deleted. Finally AD.Account.SetProperty uses the active directory paths in column 2.
Replace cn with samAccountName in the Data.Get.AD command to search by samAccountName.