Tuesday, May 18, 2010

Windows Batch Scripting and Win2k8 AD GPO Functionality

Created this script and saved it as a .bat file to loop through values stored in a comma-delimited file to reboot specific machines:

FOR /F %%A IN (filename.csv) DO (
ECHO. %%A >> result.txt %1
shutdown -m \\%%A -r -f -t 10 -c "Your workstation will reboot in 10 seconds for scheduled maintenance" >>result.txt %1
)

And some cool functionality that you can do using GPOs in AD 2008:
  • Set/Change Local User Passwords on all workstations in the domain
  • Map network drives without using vb scripts/batch files
  • Map printers without using vb scripts/batch files
  • Disable USB storage devices using REG keys
  • Disable specific hardware devices (CDROM drives, imaging devices, etc)

No comments: