Skip to content

Instantly share code, notes, and snippets.

@joncutrer
Created February 8, 2024 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncutrer/330de3648ed7e5db1d295a80600b246a to your computer and use it in GitHub Desktop.
Save joncutrer/330de3648ed7e5db1d295a80600b246a to your computer and use it in GitHub Desktop.
Windows Batch Script to reboot UniFi APs via SSH (using plink.exe)
REM ssh-reboot.bat
REM This script requires a copy of plink.exe from Putty placed in the same folder as the script or somewhere in the path.
set aplist=192.168.1.12,192.168.1.13,192.168.1.14
set user=<yoursshusername>
set pw=<yoursshpassword>
set cmd=reboot
set targetip=%1
echo %targetip%
(for %%a in (%aplist%) do (
echo Rebooting AP: %%a
echo y | plink %user%@%%a -ssh -pw %pw% %cmd%
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment