There is a stored procedure and a PowerShell script here http://paulbrewer.wordpress.com/2013/10/12/database-restore-automation/ . They can be used for a log shipping solution, to reinitialize database mirroring or Availability Groups and to verify the integrity of production backups. I'd really appreciate any feedback.
Thanks