Hi,
I would like to add all the individual MAC addresses for each corresponding computer account in Active Directory through PowerShell. The list has already been created in a CSV file.
The column headers in the CSV file are as followed:
sAMAccountName,targetAddress
I checked the info in the CSV file list and the computer names and their corresponding mac addresses are on the same line seperated by a comma, so the CSV file is correct. There are over 100 computers in the list.
I want to write all the MAC addresses to the targetAddress attribute of each of their corresponding computer in AD, but my command is not working.
Here is my command:
Import-Csv c:\updateAD.csv | Set-ADcomputer -Identity { $_.sAMAccountName } -add @{targetAddress = $_.targetAddress}
Can someone help with the syntax, or perhaps I must use a different algorithm ?
Kind Regards,