Backup-ASDatabase with -Locations Parameter

Вопрос Backup-ASDatabase with -Locations Parameter

  • 31 июля 2012 г. 15:03
     
     

    I cannot seem to get the new AS2012 CmdLet to work when using the

    -Locations

    Parameter. Without it, everything works like a charm. Also there seems to be nothing yet in cyberspace about this.

    Has anyone ever dealt with this? Thanks.

    Backup-ASDatabase                            `
     -Server Server\Instance            `
     -BackupFile FileName.abf      `
     -Database DB_Name                     `
     -AllowOverwrite                      `
     -ApplyCompression                    `
     -Locations \\Server\Share

    Backup-ASDatabase : A parameter cannot be found that matches parameter name 'Locations'.
    At C:\Users\UserName\Desktop\BackupASDatabase.ps1:11 char:12
    +     -Locations <<<<  \\Server\Share
        + CategoryInfo          : InvalidArgument: (:) [Backup-ASDatabase], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.AnalysisServices.PowerShell.Cmdlets.BackupASDatabase

Все ответы

  • 31 июля 2012 г. 15:35
     
     

    Hi,

    Just a thought: maybe you have to double the backslashes to escape them, i. e. use "\\\\Server\\Share"

    Frank

  • 31 июля 2012 г. 16:19
     
      С кодом

    The Backup-ASDatabase doesn't have a -Locations parameter it has only the -BackupFile parameter which should provide the full path to the backup file. Also the DB name is specified using the -Name parameter.

    Backup-ASDatabase -Server localhost\default -Name AdventureWorksDW2012Multidimensional-EE -BackupFile \\serverpath\folder\BackupFile.abf -AllowOverwrite -ApplyCompression

    For details use:

    get-help backup-asdatabase -full

  • 1 августа 2012 г. 6:41
     
     

    Thanks for the reply.

    BOL does specify a -Locations Parameter.

    http://msdn.microsoft.com/en-us/library/hh479574.aspx

    I'll try your solution right away.

  • 1 августа 2012 г. 6:53
     
     

    Going this route

    Backup-ASDatabase                            `
     -Server Server\Instance            `
     -BackupFile \\Server\Share\FileName.abf      `
     -Database DB_Name                     `
     -AllowOverwrite                      `
     -ApplyCompression

    did indeed work. I wonder though why BOL then specifies a -Locations Parameter?

    Thanks lots.