title: Restart-Computer Access Denied Error
body: <p>I'm currently creating a PowerShell script who need to be able to rename computer name:</p>
  
  <pre><code>Write-Host "Enter the new computer name: " -NoNewline
  $name = Read-Host
  Rename-Computer -NewName $name
  </code></pre>
  
  <p>And when I execute this code I got this error, even if I start the script with Administrator rights, I get the same error.</p>
  
  <blockquote>
    <p>Rename-Computer : The computer "LAPTOP-ASVDNCPD" could not be renamed to "[new_computer_name]" because of the following exception: Access Denied.</p>
  </blockquote>