title: PowerShell to delete Desktop Items from a remote PC
body: <p>I have 200 PC that need to have some specific icons removed.</p>
  
  <p>I created a CSV file with the ComputerName (1 name per row)</p>
  
  <p>I have another file with the file name of the icon that needs to be removed from the desktops (Shortcut1.lnk, etc). This other file is also a CSV (1 file name per row).</p>
  
  <p>How can I run a PowerShell script to remove those icons. (Please note that not all computers in my CSV file maybe turned on. Some maybe off or have network issues).</p>
  
  <pre><code>$SOURCE = "C:\powershell\shortcuts"
  $DESTINATION = "c$\Documents and Settings\All Users\Desktop"
  $LOG = "C:\powershell\logs\logsremote_copy.log"
  $REMOVE = Get-Content C:\powershell\shortcuts-removal.csv
  
  Remove-Item $LOG -ErrorAction SilentlyContinue
  $computerlist = Get-Content C:\powershell\computer-list.csv
  
  foreach ($computer in $computerlist) {
    foreach ($file in $REMOVE) {
      Remove-Item "\\$computer\$DESTINATION\$file" -Recurse
    }
  }
  </code></pre>
  
  <p>This is my code so far but it doesn't appear to delete the files from</p>
  
  <pre><code>\\computername\c$\Documents and Settings\All Users\Desktop
  </code></pre>
  
  <p>I am getting errors and warnings. The log file also doesn't seem to be creating. </p>
  
  <p>Anyway to get a report of what was deleted. what was not deleted?</p>