title: Deleting all locally stored user profiles on log off
body: <p>I want to delete all locally stored  user profiles  on logoff using a Powershell script. I've the following script: </p>
  
  <pre class="lang-bsh prettyprint-override"><code>Set-ExecutionPolicyRemoteSigned[gc]::collect() 
  cmd /c start reg unload "HKCU"Remove-PSDrive HKCU import-module C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ManageUserProfiles\ManageUserProfiles.PSM1 
  get-userprofile |where{ $_.SID -ne ("S-1-5-21-3071724114-2656578308-4228372245-500")} | remove-userprofile
  </code></pre>
  
  <p>I'm a complete newbie to powershell. So could someone tell me whether this script meets my needs and how does it run? And could you also explain what <code>$_.SID -ne ("S-1-5-21-3071724114-2656578308-4228372245-500")</code> means too. Thanks in advance.</p>