How to shutdown Windows XP via script

Basically there are two ways of shutting down Windows via Scripts: With admin-rights or without.

The tools that work with admin rights are:

  • shutdown.exe which comes with Windows XP Pro etc.
  • psshutdown.exe which comes with pstools (sysinternals.com)
  • the WMI method

Tools that work without admin rights: AutoIt-Script with single call “shutdown(13)”.

Granting access to non admin users to shutdown

In the  administrative tools – local security settings – local policies – user rights assignment:  Click “Force shutdown from a remote system” at the right. Click “Add User or Group”.  Enter the name INTERACTIVE and click “Check names”. This gives the right only to an interactive user. Its not possible to shutdown the computer over the network with that setting.

Baculas autolabeling feature is not fault-tolerant

When Bacula needs a new tape in a pool, it can automatically label a blank one and write to it afterwards. Unfourtunatley the database/catalog entry is created before the new tape is known to be labeled successfully. So it can happen, that when an unappropriate tape (e.g. already labeled, from another pool) is in the drive, bacula creates a catalog entry in the Media table for a new tape and waits forever to have that tape (which doesn’t really exist) to be mounted.

In this case you have to cancel the corresponding backup jobs and delete manually the catalog entry with the delete command in bconsole. Continue reading “Baculas autolabeling feature is not fault-tolerant”