O'Reilly logo

SQL Server 2012 with PowerShell V3 Cookbook by Donabel Santos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing backup header and file list information

In this recipe, we will look at listing backup header information from a backup file.

Getting ready

For this task, we will look at listing an existing backup's header information.

Note

If you do not have any backups in your system yet, you can do any of this chapter's backup recipes prior to performing this recipe.

How to do it...

To list the header information, follow these steps:

  1. Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
  2. Import the SQLPS module as follows:
    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. Add the following script and run:
    $instanceName = "KERRIGAN" $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required