Check Mirror and Witness Status Before Rebooting

The following script, meant to run as part of a pre-check for automated reboots, will check that all mirrored databases are in a Synchronized status and the witness is in a Connected status.  If the above conditions are true, the script returns a 0 exit code, otherwise, it returns < 0.
See http://msdn.microsoft.com/en-us/library/ms189902.aspx for more on mirroring quorum.

Add User/Group to Local Administrators Group

The follow will prompt to add a given domain user/group to local admins on multiple boxes

TortiseSVN's Revision in as version number in .NET

From scavaging the around the web, I pieced together the follow steps to setup TortiseSVN’s revision number (aka subwcrev) and time stamp as part of the assembly version.

  1. Copy the existing Properties\AssemblyInfo.cs file to a file named AssemblyInfo.template
  2. Edit the file, changing to the following:
  3. Edit the Project properties, adding the following Pre-Build events:
  4. Build your code, and display the assembly version info with the following snippet: