Restore-ASDatabase

Restores a specified Analysis Service database from a backup file.
Restore-ASDatabase [-RestoreFile*] <string> [-Name*] <System.String> [-AllowOverwrite <SwitchParameter>] [-Locations<Microsoft.AnalysisServices.RestoreLocation[]>] [-Security <Microsoft.AnalysisServices.RestoreSecurity>][-Password <System.SecureString>] [-StorageLocation <System.String>] [-Server <string>] [-Credentials<PSCredential>] [<CommonParameters>]

Enables a database administrator to restore the Analysis Service Database from a backup file. If only backup file name is mentioned without the location, the default backup location specified during the installation will be considered.

Parameters
-RestoreFile <System.String>

  • This value is required

Restores a specified Analysis Service database from a backup file.

-Name <System.String>

  • This value is required

Analysis Services Database Name that has to be restored.

-AllowOverwrite <SwitchParameter>

Indicates whether the destination files can be overwritten during resetore.

-Locations <Microsoft.AnalysisServices.RestoreLocation[]>

Remote location of the partitions to be restored.

-Security <Microsoft.AnalysisServices.RestoreSecurity>

Represents security settings for the restore operation.

CopyAll

SkipMembership

IgnoreSecurity

-Server <System.String>

  • Default value is localhost

Specifies the Analysis Services instance to which the cmdlet will connect and execute. If not server name is specified, the cmdlet will try to connect to localhost. For default instances, only specify the computer name: “MyComputer”. For named instances, use the format “ComputerNameInstanceName” For IIS Server, use the format http[s]://server[:port]/virtualdirectory/msmdpump.dll.

-Credentials <PSCredential>

If this parameter is specified, the user name and password passed will be used to connect to specified Analysis Server instance. If no credentials are specified default windows account of the user who is running the tool will be used.

-StorageLocation <System.String>

Database storage location.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs

System.String

Examples
  1. Restore the backup file ‘mydb.abf’ to database ‘mydatabase’:
    C:PS> Restore-ASDatabase mydb.abf mydatabase
    

    The backup file will be available at the default backup location specified during Analysis Service installation.

  2. Restore the backup file ‘mydb.abf’ to database ‘mydatabase’ using the password that was specified when the backup file was created:
    C:PS> Restore-ASDatabase "D:MyFoldermydb.abf" mydatabase -Password:$pwd
    
  3. Restore the backup file ‘mydb.abf’ to database ‘mydatabase’:
    C:PS> Restore-ASDatabase "D:MyFoldermydb.abf" mydatabase -Security:CopyAll
    

    While Restoring the database restores all the roles and the corresponding members from the backup database to new database.

Additional Notes