Dela via


New-RestoreLocation

Used to add a restore location to the server.

Syntax

New-RestoreLocation
   [-File <String>]
   [-DataSourceId <String>]
   [-ConnectionString <String>]
   [-DataSourceType <RestoreDataSourceType>]
   [-Folders <RestoreFolder[]>]
   [-AsTemplate]
   [-Server <String>]
   [-Credential <PSCredential>]
   [-ServicePrincipal]
   [-ApplicationId <String>]
   [-TenantId <String>]
   [-CertificateThumbprint <String>]
   [-ProgressAction <ActionPreference>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-RestoreLocation
   [-Server <String>]
   [-Credential <PSCredential>]
   [-ServicePrincipal]
   [-ApplicationId <String>]
   [-TenantId <String>]
   [-CertificateThumbprint <String>]
   [-ProgressAction <ActionPreference>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-RestoreLocation
   [-Server <String>]
   [-Credential <PSCredential>]
   [-ServicePrincipal]
   [-ApplicationId <String>]
   [-TenantId <String>]
   [-CertificateThumbprint <String>]
   [-ProgressAction <ActionPreference>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-RestoreLocation
   [-Server <String>]
   [-Credential <PSCredential>]
   [-ServicePrincipal]
   [-ApplicationId <String>]
   [-TenantId <String>]
   [-CertificateThumbprint <String>]
   [-ProgressAction <ActionPreference>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-RestoreLocation cmdlet contains information used to restore a database, including the connection string of the server and database, data source properties, files and folders associated with the database that is being restored.

Module requirements: version 21+ on PowerShell 5.1; version 21 (recent preview) or version 22+ on PowerShell 7.x.

Parameters

-ApplicationId

The application Id for the service principal.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsTemplate

Specifies whether the object should be created in memory and returned.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CertificateThumbprint

The certificate thumbprint for the service principal.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionString

Specifies the connection string of a remote Analysis Services instance.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

This parameter is used to pass in a username and password when using an HTTP connection to an Analysis Service instance, for an instance that you have configured for HTTP access. For more information, see Configure HTTP Access to Analysis Services on Internet Information Services (IIS) 8.0 for HTTP connections.

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

To use this parameter, first create a PSCredential object using Get-Credential to specify the username and password (for example,

$Cred = Get-Credential "adventure-works\bobh"

. You can then pipe this object to the �Credential parameter (

-Credential $Cred

).

Type:PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DataSourceId

@{Text=}

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DataSourceType

Specifies whether the data source is remote or local, based on the location of the partition.

Type:RestoreDataSourceType
Accepted values:Remote, Local
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-File

Specifies the name of the backup file that you are restoring.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Folders

Specifies partition folders on the local or remote instance.

Type:RestoreFolder[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.

Type:ActionPreference
Aliases:proga
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Server

Optionally specifies the server instance to connect to if not currently in the SQLAS Provider directory.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServicePrincipal

Specifies that this connection is using service principal.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

The tenant Id for the service principal.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Notes

Supported on all Analysis Services instances