Wow. I wish I had found this about 3 weeks ago. I wrote my own procedure to create DB restore scripts based on our DR needs. However, yours has waaaay more functionality, so I'll be testing it on our systems and probably switch to it.
I have two questions:
1) My script may do a couple things that this does not - first thing that comes to mind is that I can pass in a list of DB names in a table variable, and it will only produce scripts for those DBs, and in the listed order. There may be a couple other things too. Would you like me to share the code so you can incorporate it?
2) Do you know of any scripts that exist to automate the backup/restore of encryption keys and certificates? I'll be building my own shortly if I can't find something.
Thanks a ton!