O'Reilly logo

SQL Server 2014 with PowerShell v5 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 FileList information

In this recipe, we will see how to list backup header information from a backup file.

Getting ready

We need to list the existing backup's header information.

Note

If you do not have any backups in your system yet, you can go back to 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 PowerShell ISE as administrator.
  2. Import the SQLPS module as follows:
    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. Add the following script and run:
    $instanceName = "localhost" $server = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName #replace this with your backup file $backupfile ...

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