Logged in as the domain admin of an Active Directory environment, I'm attempting to run this command to reboot a workstation:
@start /b cmd /c shutdown -r -f -t 1 -m \\COMPUTER-NAME
I'm getting this error:
COMPUTER-NAME: Access is denied
Why would the domain admin be denied access to execute this command?
The issue was caused by a DNS Host(A) record that got auto-created 4 years ago: where another computer (renamed since) use to have the same name as the current computer I was trying to remotely reboot. That old record pointed to a different IP address than what the current computer (with that same name) is currently using via a dhcp reservation.
Harry Johnston suggested this command:
That produce this error:
He also suggested pining "computer-name", which showed the wrong IP address!
So, I guess the shutdown command would not permit the reboot, because the computer that this old dns record pointed to was not the computer I was trying to reboot; the name in DNS did not match the name on the computer specified in the shutdown command. "Accessed denied", was all the shutdown command produced. Its too bad it wouldn't indicate WHY access was denied.
Anyway, after removing that old dns record, the remote reboot succeeded.