Skip to content

Instantly share code, notes, and snippets.

@win2000b
Created July 30, 2019 10:24
Show Gist options
  • Save win2000b/9b12d199551993b202bacd140e6f58ee to your computer and use it in GitHub Desktop.
Save win2000b/9b12d199551993b202bacd140e6f58ee to your computer and use it in GitHub Desktop.
Get ASR Vault Settings
$dnsname = "Whatever"
$dt = $(Get-Date).ToString("M-d-yyyy")
$cert = New-SelfSignedCertificate -DnsName $dnsname
$certficate = [Convert]::ToBase64String($cert.RawData)
$VaultFile = Get-AzRecoveryServicesVaultSettingsFile -SiteRecovery -Vault $vault -Certificate $certficate.ToString()
Import-AzRecoveryServicesAsrVaultSettingsFile -Path $VaultFile.FilePath
$cert | Remove-Item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment