18 lines
1.1 KiB
PowerShell
18 lines
1.1 KiB
PowerShell
AZURE Fileshare for Offsite Backups Switzerland
|
|
|
|
subscription ID: b7789be5-9bd4-46b4-8354-c3f2ff47b157
|
|
|
|
|
|
to connect a drive to the Azure FileShare
|
|
|
|
$connectTestResult = Test-NetConnection -ComputerName chveeamoffsitebackup.file.core.windows.net -Port 445
|
|
if ($connectTestResult.TcpTestSucceeded) {
|
|
# Save the password so the drive will persist on reboot
|
|
cmd.exe /C "cmdkey /add:`"chveeamoffsitebackup.file.core.windows.net`" /user:`"localhost\chveeamoffsitebackup`" /pass:`"SS2HkMfj/KCHqcAnrMkX/olJ8WLNHBPm67u58aB3Z6/0//XHQ3bnissvic8BRRJE9e1DPcQeh5An+AStY7iWQw==`""
|
|
# Mount the drive
|
|
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\chveeamoffsitebackup.file.core.windows.net\ch-sql-backup-archive-01" -Persist
|
|
} else {
|
|
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
|
|
}
|
|
`"SS2HkMfj/KCHqcAnrMkX/olJ8WLNHBPm67u58aB3Z6/0//XHQ3bnissvic8BRRJE9e1DPcQeh5An+AStY7iWQw==`
|
|
|