Im trying to write a powershell
script to change attribute called "comment
" in a list of pcs using csv
and import-Csv
.
Here is my script
$computers=Import-Csv -Path "C:\sds.csv"
foreach ($item in $computers){
Set-ADComputer -identity $computers.DistinguishedName -add @{comment="bara"}
}
and hear is my csv
file located under "C:\sds.csv"
But it jumps in to this ..
Tried googling and changing here and there, yet does not work! I have very little understanding of power-shell script, yet wish to learn. Can someone guide me please what im messing up ?