0

powershell 用于自动备份 AAS 实例。该实例具有多因素身份验证,我认为这就是问题所在。

在此处输入图像描述

电源外壳:

 $TenantId = "TenentID"  
 $Cred = Get-AutomationPSCredential -Name 'SSASModelBackup'
 $Server = "ServerName" 
 $RolloutEnvironment = "location.asazure.windows.net" 
 $ResourceGroup = "ReourceGroupName"

 #Create Credentials to convertToSecureString
 $applicationId = "applicationId " 
 $securePassword = "securePassword " | ConvertTo-SecureString -AsPlainText -Force $Credential = New-Object
-TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword



#Define the list of AAS databases  
$asDBs = @('database1','database2') 
Write-Output "Logging in to Azure..."   

#Add-AzureAnalysisServicesAccount -Credential $Credential -ServicePrincipal -TenantId $TenantId -RolloutEnvironment $RolloutEnvironment
ForEach($db in $asDBs)
 {
  Write-Output "Starting Backup..."
   Backup-ASDatabase `
  –backupfile ($db +"." + (Get-Date).ToString("ddMMyyyy") + ".abf") `
  –name $db `
  -server $Server `
  -Credential $Cred
  Write-Output "Backup Completed!" 
 }
4

1 回答 1

0

您是正确的,问题在于多因素身份验证。由于多因素的重点是需要与手机等辅助资源进行交互,因此无法自动化该过程。

我建议您考虑使用服务原则身份验证来进行备份。通过对您的服务器使用服务原则,您可以允许自动化任务在没有 2 因素的情况下运行,同时最大限度地降低安全风险。

于 2019-07-12T15:18:07.790 回答