If I recall correctly, there are two problems with using shutdown scripts to shut down guests:
1. the account the shutdown script runs under
2. the point in the host shutdown at which the shutdown script runs
#1: You need to make sure that the account being used by any script calling Vboxmanage is the same account that you logged on the host with, and which is running the guests. This will help you run backup scripts and such, but will not get around #2
#2: The Group Policy shutdown script runs after the part of the OS that shuts down desktop applications, which includes your guests. Windows asks to close / kills your desktop apps, then later runs the GP script. So even if your script is running in the right account, all of your guests have been killed by the OS before the script starts running, and so there's no guests for Vboxmanage to find.
A solution to get your guests to run with the host start-up and shutdown without these issues is to run your guests as a service (see
viewtopic.php?f=6&t=4762) It supports both full shutdown or save-state of the guests on host shutdown. I've used it before, it works well. One drawback, you can't use Vboxmanage on these guests while the service is running them - different accounts. So no backup scripts, no heartbeat/restart scripts, etc. Just start & save-state/shutdown. You can stop the guests while the host is still running, then restart them with the Virtualbox GUI, do something with them, then shut them down and restart the service, but no Vboxmanage while running as a service.
The solution I use: I run the host with automatic log-on of the account (google Sysinternals Auto Log On) then launch my guests with a script or shortcuts in the Startup menu. Vboxmanage has full access. I don't use the OS's Start Menu button to shut down the host - I used the hosts' Group Policy to disable Shutdown & Restart & Log Off ; "Lock" is my default. I can lock the host to prevent unauthorized access while the guests are fully operational. To shut down the host,I use a script to call Vboxmanage and shut down the guests first, then call Shutdown.exe to shut down or reboot the host. I set Windows Updates on the host to Download and Manual Install so the host won't reboot unexpectedly. I use a VBS script from Microsoft's TechNet to install Windows Updates from a script which makes sure the guests are shutdown with Vboxmanage before the Updates are run and the host reboots. So far everything works well.