Koldov Posted April 22, 2021 Posted April 22, 2021 (edited) Just out of interest really... and it's something basic that I guess I should already know. Firstly, I have a scheduled task to shut down all ICT suite PCs at 15:30. Secondly, this task is also enabled to be run 'on-demand'. I have tried to run a remote 'shutdown.exe' but it fails with an error 'The entered computer name is not valid or remote shutdown is not supported on the target computer. Check the name and then try again or contact your system administrator.(53)'. Not wanting to mess with 3rd party tools if I can help it, or registry settings, or services, as it isn't worth it. But I'm just sitting here wondering as I've turned them all on today to get updates sorted and things... is there a way I can use the 'on-demand' part of the scheduled task to demand they shut down now? Googling is a bit of a rabbit hole for this kind of search unfortunately. Edited April 22, 2021 by Koldov
Rob_D Posted April 22, 2021 Posted April 22, 2021 If it's scheduled in windows task scheduler on the server (how I've had it set up before), then you should be able to just right click on the task and go "run now". I guess Shutdown /m \\COMPUTERNAME /f /s is what's kicking out your error. Have you tried using the Shutdown /i interface?
MartinByard Posted April 22, 2021 Posted April 22, 2021 USe a batch file running on your PC (or server) that calls the scheduled task ? schtasks /Run [/s system [/u username [/P [password]]]] /TN taskname Presuming the account running a cmd prompt is admin on the remote machines, the scheduled task is called "Daily Shutdown" then the following command should run the task on the remote computer "ExamplePC" schtasks /Run /S ExamplePC /TN "Daily Shutdown" It could be awkward to create the batch file, depending on how many PCs you need to run the task on ...
Jawloms Posted April 22, 2021 Posted April 22, 2021 I don't go on computer name, I just shutdown every IP address in the DHCP scope, but not at 15:30 in the afternoon!
Koldov Posted April 22, 2021 Author Posted April 22, 2021 If it's scheduled in windows task scheduler on the server (how I've had it set up before), then you should be able to just right click on the task and go "run now". I guess Shutdown /m \\COMPUTERNAME /f /s is what's kicking out your error. Have you tried using the Shutdown /i interface? The scheduled tasks have been created on the remote computers with a GPP. Yes it was the /i interface I was using and added all the relevant computers from the search function. It may be as I said that some registry settings for remote access, or services aren't running, or firewall port isn't open, as these are heavily locked down student computers. It could be awkward to create the batch file, depending on how many PCs you need to run the task on ... There are 30 computers in each suite and I usually only work on 1 suite at a time (so 30).
Chaniel Posted April 22, 2021 Posted April 22, 2021 If you really need to, use PowerShell imo. https://sid-500.com/2018/10/15/restart-all-computers-in-a-specific-ou/ Amend line 1 to fit your environment/OU structure. Change line 6 for the Stop-Computer cmdlet You can also do this by using a text file of the computer names $s = Get-Content -Path ./Domain01.txt$c = Get-Credential -Credential Domain01\Admin01Stop-Computer -ComputerName $s -Force -Credential $c
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now